* lisp/vc/diff-mode.el (diff-file-kill): New optional DELETE
parameter.
(diff-kill-creations-deletions):
* lisp/vc/vc.el (vc--fileset-by-state): New functions.
(diff-kill-creations-deletions, diff-filename-drop-dir)
(diff-hunk-file-names, diff-file-next, diff-hunk-header-re)
(vc-dir-resynch-file): Declare.
(vc--apply-to-other-working-tree): Handle copying and moving
files in the added, removed, missing and unregistered states.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--apply-to-other-working-tree): New test.
* lisp/vc/vc-dir.el (vc-dir-mark-file): Prompt before unmarking
all subitems. Use y-or-n-p and user-error instead of
yes-or-no-p and error.
(vc-dir-unmark-file): Use y-or-n-p instead of yes-or-no-p.
(vc-dir-allow-mass-mark-changes): Update docs.
* lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): When the
region is active, operate on all hunks it overlaps.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.
* lisp/vc/diff-mode.el (diff-apply-buffer): New 'no-save'
meaning for fourth optional argument. Reserve other non-nil
values for this argument. Use ngettext for one message.
(diff-apply-hunk): If the region is active, apply all hunks that
the region overlaps, like diff-apply-buffer.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change to diff-apply-hunk.
* lisp/vc/diff.el (diff-file-local-copy): Use proper coding-system
when writing a local copy of a non-file visiting buffer.
* lisp/misearch.el (coding-system--for-buffer-diff): New variable.
(multi-file-replace-as-diff): Bind it to 'utf-8-emacs'.
(multi-file-diff-no-select): Use proper coding-system when reading
output of Diff. (Bug#79761)
* lisp/vc/vc-dispatcher.el (auto-revert-buffers): Delete.
(vc-resynch-window): Always call vc-revert-buffer-internal.
Calling auto-revert-buffers will not necessarily revert the
current buffer, but we want it to happen synchronously.
* lisp/vc/vc-git.el (vc-git--file-list-is-rootdir):
Merge into vc-git-command.
(vc-git-command): When operating on the repository root, first
bind default-directory to that root. When operating on the
repository root with 'git checkout', pass "." as FILE-OR-LIST.
This reverts this change:
Author: Sean Whitton <spwhitton@spwhitton.name>
AuthorDate: Thu Oct 30 20:45:31 2025 +0000
Commit: Sean Whitton <spwhitton@spwhitton.name>
CommitDate: Fri Nov 7 15:40:25 2025 +0000
vc-exec-after: Pass zero timeout to accept-process-output
* lisp/vc/vc-dispatcher.el (vc-exec-after): Pass zero timeout to
accept-process-output.
Fix due to Spencer Baugh <sbaugh@janestreet.com>.
See thread starting at
<https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00263.html>
* lisp/vc/vc-dispatcher.el (vc-do-command): Restore using a pipe
in the async case. This was unintentionally changed when adding
support for discarding output.
* lisp/vc/vc-dispatcher.el (vc-do-command): Support discarding
standard error.
* lisp/vc/vc-hg.el (vc-hg-dir-status-files): Discard standard
error of 'hg status' to avoid parsing mistakes.
(vc-hg-command): Update docstring given new meaning of first
argument to vc-do-command.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-do-command-1)
(vc-test-do-command-2, vc-test-do-command-3)
(vc-test-do-command-4, vc-test-do-command-5)
(vc-test-do-command-6, vc-test-do-command-7): New tests.
Restore yellow colors previously used in the 'diff-changed' face.
Copy color values from 'smerge-base'. This will distinguish them
from grey 'diff-file-header' and 'diff-hunk-header' in context diffs.
This function is shortly to gain support for separating standard
output and standard error from the child. Commit untabifying it
first to make the diff adding the new features more readable.
This will include documented support for BUFFER nil, meaning to
discard output.
* lisp/vc/vc-dispatcher.el (vc-do-command): Untabify the source
in preparation for work on this function. If BUFFER is nil,
signal an error, in keeping with the current docstring.
Use ensure-list. Use equal not string= for string comparison.
Avoid getting stuck waiting for `diff` to refine big hunks.
* lisp/vc/diff-mode.el (diff-refine-threshold): New custom var.
(diff--refine-hunk): Add arg `skip-if-large` and use that new var if
the arg says so.
(diff-refine-hunk): Add arg `skip-if-large`.
(diff-auto-refine-mode, diff-next/prevhunk, diff--font-lock-refined):
Use it.
* lisp/vc/vc-dispatcher.el (vc-exec-after): Refactor so as to no
longer repeatedly add and remove the sentinel. Don't have two
different ways to set mode-line-process. Don't call
accept-process-output from the sentinel, because Emacs always
reads all available process output before calling sentinels.
* lisp/vc/vc-dispatcher.el (vc--process-sentinel, vc-exec-after):
Merge vc--process-sentinel into vc-exec-after. Tidy up. This
should not involve any functional changes; those are to follow.
* lisp/vc/vc-dispatcher.el (log-edit-hook): Declare.
(vc-start-logentry): Bind log-edit-hook to nil when finishing
the log edit immediately with a caller-supplied message.
* lisp/vc/log-edit.el (log-edit): Don't emit a message when
MODE.
* lisp/vc/vc-dispatcher.el (vc-start-logentry): Use '\\<>' to
simplify the code slightly.
* lisp/progmodes/project.el (project-compile): Ignore
compile-command from vc-compilation-mode (bug#79658).
* lisp/vc/vc-dispatcher.el (vc-compilation-mode-hook): New
variable.
(vc-compilation-mode): Promote to its own derived mode. Don't
use define-derived-mode in order to preserve the BACKEND
argument to this function. Don't give it its own major mode
map, et cetera, for now.
* lisp/vc/vc-git.el (vc-git--assert-revision-on-branch): New
function, factored out.
(vc-git-revision-published-p): Use it.
(vc-git-delete-revision):
* lisp/vc/vc-hg.el (vc-hg-delete-revision): New functions.
* lisp/vc/vc.el: Specify delete-revision backend API function
(bug#79408).