Document the recently added branch commands (bug#50344)

* doc/emacs/maintaining.texi (VC Directory Commands): Change the
prefix key from "B" to "b".  Replace vc-create-tag with vc-create-branch,
and vc-retrieve-tag with vc-switch-branch.
(Switching Branches): Mention vc-switch-branch bound to 'C-x v b s'.
(Creating Branches): Mention vc-create-branch bound to 'C-x v b c'.

* lisp/vc/vc-dir.el (vc-dir-mode-map): In branch keymap 'b' rebind
"c" from vc-create-tag to vc-create-branch, and "s" from
vc-retrieve-tag to vc-switch-branch.
This commit is contained in:
Juri Linkov 2022-09-12 22:12:50 +03:00
parent bcc95bd66d
commit 5e6a7a210b
3 changed files with 15 additions and 11 deletions

View file

@ -1398,18 +1398,19 @@ Apart from acting on multiple files, these commands behave much like
their single-buffer counterparts (@pxref{Search}).
The VC Directory buffer additionally defines some branch-related
commands starting with the prefix @kbd{B}:
commands starting with the prefix @kbd{b}:
@table @kbd
@item B c
Create a new branch (@code{vc-create-tag}).
@item b c
Create a new branch (@code{vc-create-branch}). @xref{Creating
Branches}.
@item B l
@item b l
Prompt for the name of a branch and display the change history of that
branch (@code{vc-print-branch-log}).
@item B s
Switch to a branch (@code{vc-retrieve-tag}). @xref{Switching
@item b s
Switch to a branch (@code{vc-switch-branch}). @xref{Switching
Branches}.
@item d
@ -1473,7 +1474,7 @@ Mercurial, command @kbd{hg update} is used to switch to another
branch.
The VC command to switch to another branch in the current directory
is @kbd{C-x v r @var{branch-name} @key{RET}} (@code{vc-retrieve-tag}).
is @kbd{C-x v b s @var{branch-name} @key{RET}} (@code{vc-switch-branch}).
On centralized version control systems, you can also switch between
branches by typing @kbd{C-u C-x v v} in an up-to-date work file
@ -1623,8 +1624,8 @@ if the current revision is 2.5, the branch ID should be 2.5.1, 2.5.2,
and so on, depending on the number of existing branches at that point.
This procedure will not work for distributed version control systems
like git or Mercurial. For those systems you should use the prefix
argument to @code{vc-create-tag} (@kbd{C-u C-x v s}) instead.
like git or Mercurial. For those systems you should use the command
@code{vc-create-branch} (@kbd{C-x v b c}) instead.
To create a new branch at an older revision (one that is no longer
the head of a branch), first select that revision (@pxref{Switching

View file

@ -1647,9 +1647,12 @@ info node. This command only works for the Emacs and Emacs Lisp manuals.
** VC
+++
*** 'C-x v b' prefix key is used now for branch commands.
'vc-print-branch-log' is bound to 'C-x v b l', and new commands are
'vc-create-branch' ('C-x v b c') and 'vc-switch-branch' ('C-x v b s').
The VC Directory buffer now uses the prefix 'b' for these branch-related
commands.
+++
*** New command '%' ('vc-dir-mark-by-regexp').

View file

@ -357,9 +357,9 @@ See `run-hooks'."
(let ((branch-map (make-sparse-keymap)))
(define-key map "b" branch-map)
(define-key branch-map "c" #'vc-create-tag)
(define-key branch-map "c" #'vc-create-branch)
(define-key branch-map "l" #'vc-print-branch-log)
(define-key branch-map "s" #'vc-retrieve-tag))
(define-key branch-map "s" #'vc-switch-branch))
(let ((mark-map (make-sparse-keymap)))
(define-key map "*" mark-map)