* lisp/vc/vc-hg.el (vc-hg-diff): When OLDVERS is ".", behave the
same as if OLDVERS was the actual working revision.
(vc-hg-previous-revision): Return ".~1" for input ".", ".~3" for
input ".^^" et cetera.
Also, when passed non-symbolic revisions, use "REV~1" instead of
"REV^" for MS-Windows compatibility.
(vc-hg-working-revision-symbol):
* lisp/vc/vc-git.el (vc-git-working-revision-symbol):
* lisp/vc/vc-hooks.el (vc-symbolic-working-revision): New
functions.
(vc-default-mode-line-string):
* lisp/vc/ediff-vers.el (ediff-vc-merge-internal):
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
* lisp/vc/vc.el (vc-diff-build-argument-list-internal)
(vc-diff-outgoing, vc-revision-other-window, vc-default-revert):
Call vc-symbolic-working-revision.
(vc-buffer-revision): Specify that this should always be a
revision number/hash, not a symbolic name.
* lisp/vc/vc-git.el (vc-git-previous-revision): Return "HEAD~1"
for input "HEAD", "HEAD~3" for input "HEAD^^" et cetera.
* lisp/vc/vc.el (vc-kill-other-working-tree-buffers): New
command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
* lisp/progmodes/eglot.el (eglot--managed-mode): Use
revert-buffer-in-progress instead of
revert-buffer-in-progress-p.
* lisp/vc/vc-hooks.el (vc-dir-resynch-file): Declare some
functions.
* lisp/vc/vc.el (vc-fileset-diff-incoming)
(vc-fileset-diff-outgoing): New commands.
(vc-root-diff-incoming): Refactor to call
vc-fileset-diff-incoming.
(vc-root-diff-outgoing): Refactor to call
vc-fileset-diff-outgoing.
* lisp/vc/vc-hooks.el (vc-incoming-prefix-map)
(vc-outgoing-prefix-map): Bind the new commands.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Document the new commands.
* lisp/vc/vc.el (vc-working-tree-switch-project): New command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it to C-x v w s.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
* lisp/vc/vc-git.el (vc-git--read-start-point): New function,
factored out of vc-git-create-tag.
(vc-git-create-tag): Use it.
(vc-git--worktrees, vc-git-known-other-working-trees)
(vc-git-add-working-tree, vc-git-delete-working-tree)
(vc-git-move-working-tree):
* lisp/vc/vc-hg.el (vc-hg-known-other-working-trees)
(vc-hg-add-working-tree, vc-hg--shared-p)
(vc-hg-delete-working-tree, vc-hg-move-working-tree): New
functions.
* lisp/vc/vc.el: Define API for known-other-working-tree,
add-working-tree, delete-working-tree and move-working-tree
backend functions.
(vc-dir-status-files): New function.
(project-current-directory-override): Declare.
(dired-rename-subdir): Autoload.
(vc-add-working-tree, vc-switch-working-tree)
(vc-delete-working-tree, vc-move-working-tree): New commands.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind them under C-x v.
* doc/emacs/vc1-xtra.texi (Other Working Trees): New node.
* etc/NEWS: Announce the new commands.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--other-working-trees): New function.
(vc-test-git07-other-working-trees)
(vc-test-hg07-other-working-trees): New tests.
* lisp/ldefs-boot.el: Regenerate.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind vc-rename-file to
C-x v R.
* doc/emacs/files.texi (Copying and Naming):
* doc/emacs/vc1-xtra.texi (VC Delete/Rename, Revision Tags):
* etc/NEWS (bindings): Document the new binding.
* lisp/vc/vc-hooks.el (auto-revert-mode): Declare.
(vc-auto-revert-mode): New global minor mode.
(vc-turn-on-auto-revert-mode-for-tracked-files): New function.
* lisp/vc/vc-dispatcher.el (auto-revert-mode)
(auto-revert-buffers): Declare.
(vc-resynch-window): Don't call vc-revert-buffer-internal when
auto-revert-mode will revert the buffer. Call
auto-revert-buffers to ensure that this reversion happens in a
timely manner.
* lisp/vc/vc.el (vc-register): Apply vc-auto-revert-mode to
buffers visiting newly registered files.
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Improve the generated docstring.
* doc/emacs/vc1-xtra.texi (VC Auto-Reverting):
* etc/NEWS: Document the new minor mode.
* lisp/vc/vc-dir.el (vc-use-incoming-outgoing-prefixes):
* lisp/vc/vc-hooks.el: Apply vc-use-incoming-outgoing-prefixes
to the corresponding bindings in vc-dir-mode-map, too.
* lisp/vc/vc-hooks.el (vc-incoming-prefix-map)
(vc-outgoing-prefix-map): New keymaps.
(vc-use-incoming-outgoing-prefixes): New user option.
* lisp/vc/vc.el (vc-root-diff-incoming, vc-root-diff-outgoing):
New commands (bug#62940).
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Document the new commands and option.
Since vc-resolve-conflicts is referenced in backend files, which only
require vc at runtime, move it to vc-hooks to avoid a void
variable error. (Bug#3860)
* lisp/vc/vc.el (vc-resolve-conflicts): Move from here...
* lisp/vc/vc-hooks.el (vc-resolve-conflicts): ...to here.
It used to be like 'define-key', but was used for making pure copies of
as much of a menu's data as possible. With purespace now gone, it can
be replaced by 'define-key'.
* lisp/bindings.el (bindings--define-key): Make into obsolete
alias for 'define-key'. Update all callers.
* lisp/vc/vc-hooks.el (vc-use-short-revision): New variable.
(vc-short-revision): New function.
* lisp/vc/vc-annotate.el (vc-annotate-use-short-revision): New
option...
(vc-annotate): ... use it.
* lisp/vc/vc-git.el (vc-git--rev-parse): Consult
'vc-use-short-revision'.
* etc/NEWS: Announce this change (bug#67062).
* lisp/vc/vc-hooks.el (vc-default-mode-line-string): Use it.
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use it.
* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use it.
* lisp/vc/vc-hooks.el (vc-mode-line-state): New function with code moved from
'vc-default-mode-line-string'.
(vc-default-mode-line-string): Use 'vc-mode-line-state'.
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use
'vc-mode-line-state' instead of hacking the string returned from
'vc-default-mode-line-string'.
* lisp/vc/vc-hg.el (vc-hg-mode-line-string): Use
'vc-mode-line-state' instead of duplicating code from
'vc-default-mode-line-string'.
* lisp/vc/vc-hooks.el (vc-ignored-state): New face.
(vc-default-mode-line-string): Add special indication and tooltip
for files that are registered, but also ignored. See
https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg00006.html
for the details of the use case.
* doc/emacs/maintaining.texi (VC Mode Line): Mention the
additional meaning of '!' in the VC status mode-line display.