aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorSean Whitton2025-07-25 19:34:04 +0100
committerSean Whitton2025-07-25 19:34:04 +0100
commit50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b (patch)
tree0911cfa9182a3910deb041c6bc7391f2ce849096 /doc
parent08ca6caa0a081cd67d253b09896c3789268da7a1 (diff)
downloademacs-50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b.tar.gz
emacs-50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b.zip
VC: New support for other working trees
* 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.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/emacs.texi1
-rw-r--r--doc/emacs/vc1-xtra.texi65
2 files changed, 66 insertions, 0 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index ba47190944a..b373dc092f8 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -868,6 +868,7 @@ Miscellaneous Commands and Features of VC
868* Change Logs and VC:: Generating a change log file from log entries. 868* Change Logs and VC:: Generating a change log file from log entries.
869* VC Delete/Rename:: Deleting and renaming version-controlled files. 869* VC Delete/Rename:: Deleting and renaming version-controlled files.
870* Revision Tags:: Symbolic names for revisions. 870* Revision Tags:: Symbolic names for revisions.
871* Other Working Trees:: Multiple sets of workfiles.
871* Version Headers:: Inserting version control headers into working files. 872* Version Headers:: Inserting version control headers into working files.
872* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 873* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
873* Preparing Patches:: Preparing and composing patches from within VC. 874* Preparing Patches:: Preparing and composing patches from within VC.
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index e35883c4819..29ae63c7e41 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -14,6 +14,7 @@
14* Change Logs and VC:: Generating a change log file from log entries. 14* Change Logs and VC:: Generating a change log file from log entries.
15* VC Delete/Rename:: Deleting and renaming version-controlled files. 15* VC Delete/Rename:: Deleting and renaming version-controlled files.
16* Revision Tags:: Symbolic names for revisions. 16* Revision Tags:: Symbolic names for revisions.
17* Other Working Trees:: Multiple sets of workfiles.
17* Version Headers:: Inserting version control headers into working files. 18* Version Headers:: Inserting version control headers into working files.
18* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 19* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
19* Preparing Patches:: Preparing and composing patches from within VC. 20* Preparing Patches:: Preparing and composing patches from within VC.
@@ -226,6 +227,70 @@ an old tag, the renamed file is retrieved under its new name, which is
226not the name that the makefile expects. So the program won't really 227not the name that the makefile expects. So the program won't really
227work as retrieved. 228work as retrieved.
228 229
230@node Other Working Trees
231@subsubsection Multiple Working Trees for One Repository
232
233@cindex other working trees
234@cindex multiple working trees
235Some VCS support more than one working tree with the same backing
236repository or revisions store. This means that you can have different
237revisions or branches (@pxref{Branches}) checked out simultaneously, in
238different working trees, but with all revision history, branches, tags
239and other metadata shared. The following commands let you switch
240between and modify different working trees.
241
242@table @kbd
243@item C-x v w c
244Add a new working tree.
245
246@item C-x v w w
247Visit this file in another working tree.
248
249@item C-x v w x
250Delete a working tree you no longer need.
251
252@item C-x v w R
253Relocate a working tree to another file name.
254@end table
255
256@kindex C-x v w c
257@findex vc-add-working-tree
258You can start using multiple working trees by using the command
259@w{@kbd{C-x v w c}} (@code{vc-add-working-tree}) to create a new working
260tree. This prompts you to specify a destination directory, which
261identifies the working tree, and which will hold the new set of
262workfiles.
263
264Different VCS have different rules about what may and must be checked
265out in other working trees, so there may be additional prompts depending
266on the VCS in use. For example, Git requires that each branch be
267checked out in only one working tree at a time, so when using Git, Emacs
268will also prompt you for the name of the branch to be checked out in the
269new working tree.
270
271@kindex C-x v w w
272@findex vc-switch-working-tree
273Once your repository has other working trees, you can use the command
274@kbd{C-x v w w} (@code{vc-switch-working-tree}) to switch between them.
275It tries to find the analogue of the current buffer's file
276under another working tree. Typically the sets of workfiles
277under different working trees differ more in file contents than in which
278files do and do not exist. In other words, the file the
279current buffer visits probably exists in other working trees too, and
280this command lets you switch to those versions of the file.
281
282@kindex C-x v w x
283@kindex C-x v w R
284@findex vc-delete-working-tree
285@findex vc-move-working-tree
286The commands @kbd{C-x v w x} (@code{vc-delete-working-tree}) and
287@kbd{C-x v w R} (@code{vc-move-working-tree}) are for performing
288maintenance tasks on other working trees, letting you delete, move and
289rename them. Deleting other working trees is particular useful because
290a common use for multiple working trees is to create throwaway copies of
291the repository to quickly test changes, without interfering with any
292work-in-progress you may have in your primary working trees.
293
229@node Version Headers 294@node Version Headers
230@subsubsection Inserting Version Control Headers 295@subsubsection Inserting Version Control Headers
231 296