diff options
| author | Chong Yidong | 2011-12-19 15:25:46 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-12-19 15:25:46 +0800 |
| commit | bc859d5f3eb942f627f113eb9e75015cb43eda02 (patch) | |
| tree | aec058576e9d3e8d2a73733d6dc19bc5f3fd8a5b | |
| parent | a6198c9097703c4ad2a686ecb1ade1af8cd52112 (diff) | |
| download | emacs-bc859d5f3eb942f627f113eb9e75015cb43eda02.tar.gz emacs-bc859d5f3eb942f627f113eb9e75015cb43eda02.zip | |
More updates for VC documentation.
* doc/emacs/maintaining.texi (VCS Merging, VCS Changesets): Index entries.
(VC Mode Line): Add index entry for "version control status".
(VC Undo): Use vc-revert instead of its vc-revert-buffer alias.
Document vc-revert-show-diff. De-document vc-rollback.
(VC Directory Mode): Rewrite introduction. Move prefix arg
documentation here from VC Directory Buffer node.
(VC Directory Buffer): Use a decentralized VCS example.
(VC Directory Commands): Use a table. Remove material duplicated
in previous nodes on multi-file VC filsets.
| -rw-r--r-- | admin/FOR-RELEASE | 30 | ||||
| -rw-r--r-- | doc/emacs/ChangeLog | 12 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 388 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
4 files changed, 235 insertions, 196 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 23d2bd2b16a..fc36fb6e1d7 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -61,13 +61,6 @@ sk Miroslav Vaško | |||
| 61 | 61 | ||
| 62 | * BUGS | 62 | * BUGS |
| 63 | 63 | ||
| 64 | ** Does deleting frames run Lisp code? If so, can we get rid of that? | ||
| 65 | It is a dangerous design. | ||
| 66 | http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01330.html | ||
| 67 | |||
| 68 | ** Why were the calls to x_fully_uncatch_errors commented out in eval.c? | ||
| 69 | http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01987.html | ||
| 70 | |||
| 71 | ** rms: gnus-dired.el is a mistake. Those features should not | 64 | ** rms: gnus-dired.el is a mistake. Those features should not |
| 72 | be part of Gnus. They should be moved to some other part of Emacs. | 65 | be part of Gnus. They should be moved to some other part of Emacs. |
| 73 | rsteib: Gnus dependencies in `gnus-dired.el' (and `mailcap.el') have been | 66 | rsteib: Gnus dependencies in `gnus-dired.el' (and `mailcap.el') have been |
| @@ -90,25 +83,8 @@ and change key bindings where necessary. The current list of modes: | |||
| 90 | `log-edit-comment-search-forward'. Perhaps search commands | 83 | `log-edit-comment-search-forward'. Perhaps search commands |
| 91 | on the global key binding `M-s' are useless in these modes. | 84 | on the global key binding `M-s' are useless in these modes. |
| 92 | 85 | ||
| 93 | ** sdl.web@gmail.com, 30 Oct: ps-lpr-switches has no effect | ||
| 94 | http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg02091.html | ||
| 95 | |||
| 96 | Fixed by this change? | ||
| 97 | |||
| 98 | 2007-11-09 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 99 | |||
| 100 | * ps-print.el: [...] | ||
| 101 | (ps-do-despool): If ps-lpr-switches is not a list, force it to be one. | ||
| 102 | |||
| 103 | ** In C, use EMACS_INT for variables and structure members | ||
| 104 | for buffer/string positions. E.g. struct it, struct text_pos. | ||
| 105 | |||
| 106 | * DOCUMENTATION | 86 | * DOCUMENTATION |
| 107 | 87 | ||
| 108 | ** Clean up Emacs.app references in code and documentation. | ||
| 109 | |||
| 110 | ** Document new font backend | ||
| 111 | |||
| 112 | ** Document XEmbed support | 88 | ** Document XEmbed support |
| 113 | 89 | ||
| 114 | ** Check the Emacs Tutorial. | 90 | ** Check the Emacs Tutorial. |
| @@ -154,7 +130,7 @@ anti.texi | |||
| 154 | arevert-xtra.texi cyd | 130 | arevert-xtra.texi cyd |
| 155 | basic.texi cyd | 131 | basic.texi cyd |
| 156 | buffers.texi cyd | 132 | buffers.texi cyd |
| 157 | building.texi | 133 | building.texi cyd |
| 158 | calendar.texi | 134 | calendar.texi |
| 159 | cal-xtra.texi | 135 | cal-xtra.texi |
| 160 | cmdargs.texi | 136 | cmdargs.texi |
| @@ -188,13 +164,13 @@ msdog-xtra.texi | |||
| 188 | mule.texi | 164 | mule.texi |
| 189 | m-x.texi cyd | 165 | m-x.texi cyd |
| 190 | picture-xtra.texi | 166 | picture-xtra.texi |
| 191 | programs.texi | 167 | programs.texi cyd |
| 192 | regs.texi cyd | 168 | regs.texi cyd |
| 193 | rmail.texi | 169 | rmail.texi |
| 194 | screen.texi cyd | 170 | screen.texi cyd |
| 195 | search.texi cyd | 171 | search.texi cyd |
| 196 | sending.texi | 172 | sending.texi |
| 197 | text.texi | 173 | text.texi cyd |
| 198 | trouble.texi | 174 | trouble.texi |
| 199 | vc-xtra.texi | 175 | vc-xtra.texi |
| 200 | vc1-xtra.texi | 176 | vc1-xtra.texi |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 20f068e4ef6..90bc9dc8c91 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-12-19 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * maintaining.texi (VCS Merging, VCS Changesets): Index entries. | ||
| 4 | (VC Mode Line): Add index entry for "version control status". | ||
| 5 | (VC Undo): Use vc-revert instead of its vc-revert-buffer alias. | ||
| 6 | Document vc-revert-show-diff. De-document vc-rollback. | ||
| 7 | (VC Directory Mode): Rewrite introduction. Move prefix arg | ||
| 8 | documentation here from VC Directory Buffer node. | ||
| 9 | (VC Directory Buffer): Use a decentralized VCS example. | ||
| 10 | (VC Directory Commands): Use a table. Remove material duplicated | ||
| 11 | in previous nodes on multi-file VC filsets. | ||
| 12 | |||
| 1 | 2011-12-17 Chong Yidong <cyd@gnu.org> | 13 | 2011-12-17 Chong Yidong <cyd@gnu.org> |
| 2 | 14 | ||
| 3 | * maintaining.texi (VCS Concepts): Make "revision" terminology | 15 | * maintaining.texi (VCS Concepts): Make "revision" terminology |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 063d0e65f5b..96d520e143c 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -227,17 +227,18 @@ these modes of operation, but it cannot hide the differences. | |||
| 227 | 227 | ||
| 228 | @node VCS Merging | 228 | @node VCS Merging |
| 229 | @subsubsection Merge-based vs lock-based Version Control | 229 | @subsubsection Merge-based vs lock-based Version Control |
| 230 | @cindex locking versus merging | ||
| 231 | 230 | ||
| 232 | A version control system typically has some mechanism to coordinate | 231 | A version control system typically has some mechanism to coordinate |
| 233 | between users who want to change the same file. There are two ways to | 232 | between users who want to change the same file. There are two ways to |
| 234 | do this: merging and locking. | 233 | do this: merging and locking. |
| 235 | 234 | ||
| 235 | @cindex merging-based version | ||
| 236 | In a version control system that uses merging, each user may modify | 236 | In a version control system that uses merging, each user may modify |
| 237 | a work file at any time. The system lets you @dfn{merge} your work | 237 | a work file at any time. The system lets you @dfn{merge} your work |
| 238 | file, which may contain changes that have not been committed, with the | 238 | file, which may contain changes that have not been committed, with the |
| 239 | latest changes that others have committed. | 239 | latest changes that others have committed. |
| 240 | 240 | ||
| 241 | @cindex locking-based version | ||
| 241 | Older version control systems use a @dfn{locking} scheme instead. | 242 | Older version control systems use a @dfn{locking} scheme instead. |
| 242 | Here, work files are normally read-only. To edit a file, you ask the | 243 | Here, work files are normally read-only. To edit a file, you ask the |
| 243 | version control system to make it writable for you by @dfn{locking} | 244 | version control system to make it writable for you by @dfn{locking} |
| @@ -274,7 +275,7 @@ possible. | |||
| 274 | @node VCS Changesets | 275 | @node VCS Changesets |
| 275 | @subsubsection Changeset-based vs File-based Version Control | 276 | @subsubsection Changeset-based vs File-based Version Control |
| 276 | 277 | ||
| 277 | @cindex changesets | 278 | @cindex file-based version control |
| 278 | On SCCS, RCS, CVS, and other early version control systems, version | 279 | On SCCS, RCS, CVS, and other early version control systems, version |
| 279 | control operations are @dfn{file-based}: each file has its own comment | 280 | control operations are @dfn{file-based}: each file has its own comment |
| 280 | and revision history separate from that of all other files. Newer | 281 | and revision history separate from that of all other files. Newer |
| @@ -283,6 +284,7 @@ commit may include changes to several files, and the entire set of | |||
| 283 | changes is handled as a unit. Any comment associated with the change | 284 | changes is handled as a unit. Any comment associated with the change |
| 284 | does not belong to a single file, but to the changeset itself. | 285 | does not belong to a single file, but to the changeset itself. |
| 285 | 286 | ||
| 287 | @cindex changeset-based version control | ||
| 286 | Changeset-based version control is more flexible and powerful than | 288 | Changeset-based version control is more flexible and powerful than |
| 287 | file-based version control; usually, when a change to multiple files | 289 | file-based version control; usually, when a change to multiple files |
| 288 | has to be reversed, it's good to be able to easily identify and remove | 290 | has to be reversed, it's good to be able to easily identify and remove |
| @@ -356,20 +358,22 @@ later use the @kbd{C-x v a} command to copy it to @file{ChangeLog} | |||
| 356 | 358 | ||
| 357 | @node VC Mode Line | 359 | @node VC Mode Line |
| 358 | @subsection Version Control and the Mode Line | 360 | @subsection Version Control and the Mode Line |
| 359 | @cindex VC, mode line indicator | 361 | @cindex VC mode line indicator |
| 360 | 362 | ||
| 361 | When you visit a file that is under version control, Emacs indicates | 363 | When you visit a file that is under version control, Emacs indicates |
| 362 | this on the mode line. For example, @samp{Bzr-1223} says that Bazaar | 364 | this on the mode line. For example, @samp{Bzr-1223} says that Bazaar |
| 363 | is used for that file, and the current revision ID is 1223. | 365 | is used for that file, and the current revision ID is 1223. |
| 364 | 366 | ||
| 367 | @cindex version control status | ||
| 365 | The character between the back-end name and the revision ID | 368 | The character between the back-end name and the revision ID |
| 366 | indicates the status of the work file. In a merge-based version | 369 | indicates the @dfn{version control status} of the work file. In a |
| 367 | control system, a @samp{-} character indicates that the work file is | 370 | merge-based version control system, a @samp{-} character indicates |
| 368 | unmodified, and @samp{:} indicates that it has been modified. | 371 | that the work file is unmodified, and @samp{:} indicates that it has |
| 369 | @samp{!} indicates that the file contains conflicts as result of a | 372 | been modified. @samp{!} indicates that the file contains conflicts as |
| 370 | recent merge operation (@pxref{Merging}), or that the file was removed | 373 | result of a recent merge operation (@pxref{Merging}), or that the file |
| 371 | from the version control. Finally, @samp{?} means that the file is | 374 | was removed from the version control. Finally, @samp{?} means that |
| 372 | under version control, but is missing from the working tree. | 375 | the file is under version control, but is missing from the working |
| 376 | tree. | ||
| 373 | 377 | ||
| 374 | In a lock-based system, @samp{-} indicates an unlocked file, and | 378 | In a lock-based system, @samp{-} indicates an unlocked file, and |
| 375 | @samp{:} a locked file; if the file is locked by another user (for | 379 | @samp{:} a locked file; if the file is locked by another user (for |
| @@ -399,6 +403,7 @@ system, but is usually not excessive. | |||
| 399 | @subsection Basic Editing under Version Control | 403 | @subsection Basic Editing under Version Control |
| 400 | 404 | ||
| 401 | @cindex filesets, VC | 405 | @cindex filesets, VC |
| 406 | @cindex VC filesets | ||
| 402 | Most VC commands operate on @dfn{VC filesets}. A VC fileset is a | 407 | Most VC commands operate on @dfn{VC filesets}. A VC fileset is a |
| 403 | collection of one or more files that a VC operation acts on. When you | 408 | collection of one or more files that a VC operation acts on. When you |
| 404 | type VC commands in a buffer visiting a version-controlled file, the | 409 | type VC commands in a buffer visiting a version-controlled file, the |
| @@ -451,9 +456,9 @@ and don't persist across sessions. | |||
| 451 | @itemize @bullet | 456 | @itemize @bullet |
| 452 | @item | 457 | @item |
| 453 | If there is more than one file in the VC fileset and the files have | 458 | If there is more than one file in the VC fileset and the files have |
| 454 | inconsistent version control states, signal an error. (Note, however, | 459 | inconsistent version control statuses, signal an error. (Note, |
| 455 | that a fileset is allowed to include both ``newly-added'' files and | 460 | however, that a fileset is allowed to include both ``newly-added'' |
| 456 | ``modified'' files; @pxref{Registering}.) | 461 | files and ``modified'' files; @pxref{Registering}.) |
| 457 | 462 | ||
| 458 | @item | 463 | @item |
| 459 | If none of the files in the VC fileset are registered with a version | 464 | If none of the files in the VC fileset are registered with a version |
| @@ -504,7 +509,7 @@ its default mode), @kbd{C-x v v} does the following: | |||
| 504 | @itemize @bullet | 509 | @itemize @bullet |
| 505 | @item | 510 | @item |
| 506 | If there is more than one file in the VC fileset and the files have | 511 | If there is more than one file in the VC fileset and the files have |
| 507 | inconsistent version control states, signal an error. | 512 | inconsistent version control statuses, signal an error. |
| 508 | 513 | ||
| 509 | @item | 514 | @item |
| 510 | If each file in the VC fileset is not registered with a version | 515 | If each file in the VC fileset is not registered with a version |
| @@ -887,7 +892,7 @@ the file contents without distraction from the annotations. | |||
| 887 | 892 | ||
| 888 | @table @kbd | 893 | @table @kbd |
| 889 | @item C-x v l | 894 | @item C-x v l |
| 890 | Display revision control state and change history | 895 | Display the change history for the current fileset |
| 891 | (@code{vc-print-log}). | 896 | (@code{vc-print-log}). |
| 892 | 897 | ||
| 893 | @item C-x v L | 898 | @item C-x v L |
| @@ -927,8 +932,8 @@ this feature). With a prefix argument, the command prompts for the | |||
| 927 | maximum number of revisions to display. | 932 | maximum number of revisions to display. |
| 928 | 933 | ||
| 929 | The @kbd{C-x v L} history is shown in a compact form, usually | 934 | The @kbd{C-x v L} history is shown in a compact form, usually |
| 930 | omitting all but the first line of each log entry. However, you can | 935 | showing only the first line of each log entry. However, you can type |
| 931 | type @key{RET} (@code{log-view-toggle-entry-display}) in the | 936 | @key{RET} (@code{log-view-toggle-entry-display}) in the |
| 932 | @samp{*vc-change-log*} buffer to reveal the entire log entry for the | 937 | @samp{*vc-change-log*} buffer to reveal the entire log entry for the |
| 933 | revision at point. A second @key{RET} hides it again. | 938 | revision at point. A second @key{RET} hides it again. |
| 934 | 939 | ||
| @@ -1008,58 +1013,67 @@ buffer. However, RCS, SCCS, and CVS do not support this feature. | |||
| 1008 | 1013 | ||
| 1009 | @table @kbd | 1014 | @table @kbd |
| 1010 | @item C-x v u | 1015 | @item C-x v u |
| 1011 | Revert the buffer and the file to the working revision from which you started | 1016 | Revert the work file(s) in the current VC fileset to the last revision |
| 1012 | editing the file. | 1017 | (@code{vc-revert}). |
| 1013 | |||
| 1014 | @item C-x v c | ||
| 1015 | Remove the last-entered change from the master for the visited file. | ||
| 1016 | This undoes your last commit. | ||
| 1017 | @end table | 1018 | @end table |
| 1018 | 1019 | ||
| 1020 | @c `C-x v c' (vc-rollback) was removed, since it's RCS/SCCS specific. | ||
| 1021 | |||
| 1019 | @kindex C-x v u | 1022 | @kindex C-x v u |
| 1020 | @findex vc-revert-buffer | 1023 | @findex vc-revert |
| 1021 | If you want to discard your current set of changes and revert to the | 1024 | @vindex vc-revert-show-diff |
| 1022 | working revision from which you started editing the file, use @kbd{C-x | 1025 | If you want to discard all the changes you have made to the current |
| 1023 | v u} (@code{vc-revert-buffer}). If the version control system is | 1026 | VC fileset, type @kbd{C-x v u} (@code{vc-revert-buffer}). This shows |
| 1024 | locking-based, this leaves the file unlocked, and you must lock it | 1027 | you a diff between the work file(s) and the revision from which you |
| 1025 | again before making new changes. @kbd{C-x v u} requires confirmation, | 1028 | started editing, and asks for confirmation for discarding the changes. |
| 1026 | unless it sees that you haven't made any changes with respect to the | 1029 | If you agree, the fileset is reverted. If you don't want @kbd{C-x v |
| 1027 | master copy of the working revision. | 1030 | u} to show a diff, set the variable @code{vc-revert-show-diff} to |
| 1028 | 1031 | @code{nil} (you can still view the diff directly with @kbd{C-x v =}; | |
| 1029 | @kbd{C-x v u} is also the command to unlock a file if you lock it and | 1032 | @pxref{Old Revisions}). Note that @kbd{C-x v u} cannot be reversed |
| 1030 | then decide not to change it. | 1033 | with the usual undo commands (@pxref{Undo}), so use it with care. |
| 1031 | 1034 | ||
| 1032 | @kindex C-x v c | 1035 | On locking-based version control systems, @kbd{C-x v u} leaves files |
| 1033 | @findex vc-rollback | 1036 | unlocked; you must lock again to resume editing. You can also use |
| 1034 | To cancel a change that you already committed, use @kbd{C-x v c} | 1037 | @kbd{C-x v u} to unlock a file if you lock it and then decide not to |
| 1035 | (@code{vc-rollback}). This command discards all record of the most | 1038 | change it. |
| 1036 | recent checked-in revision, but only if your work file corresponds to | ||
| 1037 | that revision---you cannot use @kbd{C-x v c} to cancel a revision that | ||
| 1038 | is not the latest on its branch. Note that many version control | ||
| 1039 | systems do not support rollback at all; this command is something of a | ||
| 1040 | historical relic. | ||
| 1041 | 1039 | ||
| 1042 | @node VC Directory Mode | 1040 | @node VC Directory Mode |
| 1043 | @subsection VC Directory Mode | 1041 | @subsection VC Directory Mode |
| 1044 | 1042 | ||
| 1043 | @cindex VC Directory buffer | ||
| 1044 | The @dfn{VC Directory buffer} is a specialized buffer for viewing | ||
| 1045 | the version control statuses of the files in a directory tree, and | ||
| 1046 | performing version control operations on those files. In particular, | ||
| 1047 | it is used to specify multi-file VC filesets for commands like | ||
| 1048 | @w{@kbd{C-x v v}} to act on (@pxref{VC Directory Commands}). | ||
| 1049 | |||
| 1045 | @kindex C-x v d | 1050 | @kindex C-x v d |
| 1046 | @findex vc-dir | 1051 | @findex vc-dir |
| 1047 | When you are working on a large program, it is often useful to find | 1052 | To use the VC Directory buffer, type @kbd{C-x v d} (@code{vc-dir}). |
| 1048 | out which files have changed within an entire directory tree, or to | 1053 | This reads a directory name using the minibuffer, and switches to a VC |
| 1049 | view the status of all files under version control at once, and to | 1054 | Directory buffer for that directory. By default, the buffer is named |
| 1050 | perform version control operations on collections of files. You can | 1055 | @samp{*vc-dir*}. Its contents are described |
| 1051 | use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory | 1056 | @iftex |
| 1052 | listing that includes only files relevant for version control. This | 1057 | below. |
| 1053 | creates a @dfn{VC Directory buffer} and displays it in a separate | 1058 | @end iftex |
| 1054 | window. | 1059 | @ifnottex |
| 1060 | in @ref{VC Directory Buffer}. | ||
| 1061 | @end ifnottex | ||
| 1055 | 1062 | ||
| 1063 | The @code{vc-dir} command automatically detects the version control | ||
| 1064 | system to be used in the specified directory. In the event that more | ||
| 1065 | than one system is being used in the directory, you should invoke the | ||
| 1066 | command with a prefix argument, @kbd{C-u C-x v d}; this prompts for | ||
| 1067 | the version control system which the VC Directory buffer should use. | ||
| 1068 | |||
| 1069 | @ifnottex | ||
| 1056 | @cindex PCL-CVS | 1070 | @cindex PCL-CVS |
| 1057 | @pindex cvs | 1071 | @pindex cvs |
| 1058 | @cindex CVS directory mode | 1072 | @cindex CVS directory mode |
| 1059 | The VC Directory buffer works with all the version control systems | 1073 | In addition to the VC Directory buffer, Emacs has a similar facility |
| 1060 | that VC supports. For CVS, Emacs also offers a more powerful facility | 1074 | called PCL-CVS which is specialized for CVS. @xref{Top, , About |
| 1061 | called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The | 1075 | PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. |
| 1062 | Emacs Front-End to CVS}. | 1076 | @end ifnottex |
| 1063 | 1077 | ||
| 1064 | @menu | 1078 | @menu |
| 1065 | * Buffer: VC Directory Buffer. What the buffer looks like and means. | 1079 | * Buffer: VC Directory Buffer. What the buffer looks like and means. |
| @@ -1070,152 +1084,188 @@ Emacs Front-End to CVS}. | |||
| 1070 | @subsubsection The VC Directory Buffer | 1084 | @subsubsection The VC Directory Buffer |
| 1071 | 1085 | ||
| 1072 | The VC Directory buffer contains a list of version-controlled files | 1086 | The VC Directory buffer contains a list of version-controlled files |
| 1073 | in the current directory and its subdirectories. Files which are | 1087 | and their version control statuses. It lists files in the current |
| 1074 | up-to-date (have no local differences from the repository copy) are | 1088 | directory (the one specified when you called @kbd{C-x v d}) and its |
| 1075 | usually hidden; if all files in a subdirectory are up-to-date, the | 1089 | subdirectories, but only those with a ``noteworthy'' status. Files |
| 1076 | subdirectory is hidden as well. There is an exception to this rule: | 1090 | that are up-to-date (i.e.@: the same as in the repository) are |
| 1077 | if VC mode detects that a file has changed to an up-to-date state | 1091 | omitted. If all the files in a subdirectory are up-to-date, the |
| 1078 | since you last looked at it, that file and its state are shown. | 1092 | subdirectory is not listed either. As an exception, if a file has |
| 1079 | 1093 | become up-to-date as a direct result of a VC command, it is listed. | |
| 1080 | If a directory uses more that one version control system, you can | 1094 | |
| 1081 | select which system to use for the @code{vc-dir} command by invoking | 1095 | Here is an example of a VC Directory buffer listing: |
| 1082 | @code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}. | ||
| 1083 | |||
| 1084 | The line for an individual file shows the version control state of | ||
| 1085 | the file. Under RCS and SCCS, the name of the user locking the file | ||
| 1086 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 1087 | output is used. Here is an example using CVS: | ||
| 1088 | 1096 | ||
| 1089 | @smallexample | 1097 | @smallexample |
| 1090 | @group | 1098 | @group |
| 1091 | ./ | 1099 | ./ |
| 1092 | modified file1.c | 1100 | edited configure.ac |
| 1093 | needs-update file2.c | 1101 | * added README |
| 1094 | needs-merge file3.c | 1102 | unregistered temp.txt |
| 1103 | src/ | ||
| 1104 | * edited src/main.c | ||
| 1095 | @end group | 1105 | @end group |
| 1096 | @end smallexample | 1106 | @end smallexample |
| 1097 | 1107 | ||
| 1098 | @noindent | 1108 | @noindent |
| 1099 | In this example, @samp{file1.c} is modified with respect to the | 1109 | Two work files have been modified but not committed: |
| 1100 | repository, and @samp{file2.c} is not. @samp{file3.c} is modified, | 1110 | @file{configure.ac} in the current directory, and @file{foo.c} in the |
| 1101 | but other changes have also been committed---you need to merge them | 1111 | @file{src/} subdirectory. The file named @file{README} has been added |
| 1102 | with the work file before you can check it in. | 1112 | but is not yet committed, while @file{temp.txt} is not under version |
| 1103 | 1113 | control (@pxref{Registering}). | |
| 1104 | @vindex vc-stay-local | 1114 | |
| 1105 | @vindex vc-cvs-stay-local | 1115 | The @samp{*} characters next to the entries for @file{README} and |
| 1106 | In the above, if the repository were on a remote machine, VC only | 1116 | @file{src/main.c} indicate that the user has marked out these files as |
| 1107 | contacts it when the variable @code{vc-stay-local} (or | 1117 | the current VC fileset |
| 1108 | @code{vc-cvs-stay-local}) is @code{nil} | ||
| 1109 | @iftex | 1118 | @iftex |
| 1110 | (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). | 1119 | (see below). |
| 1111 | @end iftex | 1120 | @end iftex |
| 1112 | @ifnottex | 1121 | @ifnottex |
| 1113 | (@pxref{CVS Options}). | 1122 | (@pxref{VC Directory Commands}). |
| 1123 | @end ifnottex | ||
| 1124 | |||
| 1125 | The above example is typical for a decentralized version control | ||
| 1126 | system like Bazaar, Git, or Mercurial. Other systems can show other | ||
| 1127 | statuses. For instance, CVS shows the @samp{needs-update} status if | ||
| 1128 | the repository has changes that have not been applied to the work | ||
| 1129 | file. RCS and SCCS show the name of the user locking a file as its | ||
| 1130 | status. | ||
| 1131 | |||
| 1132 | @ifnottex | ||
| 1133 | @vindex vc-stay-local | ||
| 1134 | @vindex vc-cvs-stay-local | ||
| 1135 | On CVS and Subversion, the @code{vc-dir} command normally contacts | ||
| 1136 | the repository, which may be on a remote machine, to check for | ||
| 1137 | updates. If you change the variable @code{vc-stay-local} or | ||
| 1138 | @code{vc-cvs-stay-local} (for CVS) to @code{nil} (@pxref{CVS | ||
| 1139 | Options}), then Emacs avoids contacting a remote repository when | ||
| 1140 | generating the VC Directory buffer (it will still contact it when | ||
| 1141 | necessary, e.g.@: when doing a commit). This may be desirable if you | ||
| 1142 | are working offline or the network is slow. | ||
| 1114 | @end ifnottex | 1143 | @end ifnottex |
| 1115 | This is because access to the repository may be slow, or you may be | ||
| 1116 | working offline and not have access to the repository at all. As a | ||
| 1117 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 1118 | in the ``merge'' state; you would learn that only when you try to | ||
| 1119 | commit your modified copy of the file, or use a command such as | ||
| 1120 | @kbd{C-x v m}. | ||
| 1121 | |||
| 1122 | In practice, this is not a problem because CVS handles this case | ||
| 1123 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 1124 | merge the remote changes into your work file first. The benefits of | ||
| 1125 | less network communication usually outweigh the disadvantage of not | ||
| 1126 | seeing remote changes immediately. | ||
| 1127 | 1144 | ||
| 1128 | @vindex vc-directory-exclusion-list | 1145 | @vindex vc-directory-exclusion-list |
| 1129 | When a VC directory displays subdirectories it omits some that | 1146 | The VC Directory buffer omits subdirectories listed in the variable |
| 1130 | should never contain any files under version control. By default, | 1147 | @code{vc-directory-exclusion-list}. The default value of this |
| 1131 | this includes Version Control subdirectories such as @samp{RCS} and | 1148 | variable contains directories that are used internally by version |
| 1132 | @samp{CVS}; you can customize this by setting the variable | 1149 | control systems. |
| 1133 | @code{vc-directory-exclusion-list}. | ||
| 1134 | 1150 | ||
| 1135 | @node VC Directory Commands | 1151 | @node VC Directory Commands |
| 1136 | @subsubsection VC Directory Commands | 1152 | @subsubsection VC Directory Commands |
| 1137 | 1153 | ||
| 1138 | VC Directory mode has a full set of navigation and marking commands | 1154 | Emacs provides several commands for navigating the VC Directory |
| 1139 | for picking out filesets. Some of these are also available in a | 1155 | buffer, and for ``marking'' files as belonging to the current VC |
| 1140 | context menu invoked by @kbd{mouse-2}. | 1156 | fileset. |
| 1141 | 1157 | ||
| 1142 | Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also | 1158 | @table @kbd |
| 1143 | move vertically as in other list-browsing modes. @key{SPC} and | 1159 | @item n |
| 1144 | @key{TAB} behave like down-arrow, and @key{BackTab} behaves like | 1160 | @itemx @key{SPC} |
| 1145 | up-arrow. | 1161 | Move point to the next entry (@code{vc-dir-next-line}). |
| 1146 | 1162 | ||
| 1147 | Both @kbd{C-m} and @kbd{f} visit the file on the current | 1163 | @item p |
| 1148 | line. @kbd{o} visits that file in another window. @kbd{q} dismisses | 1164 | Move point to the previous entry (@code{vc-dir-previous-line}). |
| 1149 | the directory buffer. | ||
| 1150 | 1165 | ||
| 1151 | @kbd{x} hides up-to-date files. | 1166 | @item @key{TAB} |
| 1167 | Move to the next directory entry (@code{vc-dir-next-directory}). | ||
| 1152 | 1168 | ||
| 1153 | @kbd{m} marks the file or directory on the current line. If the | 1169 | @item S-@key{TAB} |
| 1154 | region is active, @kbd{m} marks all the files in the region. There | 1170 | Move to the previous directory entry |
| 1155 | are some restrictions when marking: a file cannot be marked if any of | 1171 | (@code{vc-dir-previous-directory}). |
| 1156 | its parent directories are marked, and a directory cannot be marked if | ||
| 1157 | any files in it or in its child directories are marked. | ||
| 1158 | 1172 | ||
| 1159 | @kbd{M} marks all the files with the same VC state as the current | 1173 | @item @key{RET} |
| 1160 | file if the cursor is on a file. If the cursor is on a directory, it | 1174 | @itemx f |
| 1161 | marks all child files. With a prefix argument: marks all files and | 1175 | Visit the file or directory listed on the current line |
| 1162 | directories. | 1176 | (@code{vc-dir-find-file}). |
| 1163 | 1177 | ||
| 1164 | @kbd{u} unmarks the file or directory on the current line. If the | 1178 | @item o |
| 1165 | region is active, it unmarks all the files in the region. | 1179 | Visit the file or directory on the current line, in a separate window |
| 1180 | (@code{vc-dir-find-file-other-window}). | ||
| 1166 | 1181 | ||
| 1167 | @kbd{U} marks all the files with the same VC state as the current file | 1182 | @item m |
| 1168 | if the cursor is on a file. If the cursor is on a directory, it | 1183 | Mark the file or directory on the current line (@code{vc-dir-mark}), |
| 1169 | unmarks all child files. With a prefix argument: unmarks all marked | 1184 | putting it in the current VC fileset. If the region is active, mark |
| 1185 | all files in the region. | ||
| 1186 | |||
| 1187 | A file cannot be marked with this command if it is already in a marked | ||
| 1188 | directory, or one of its subdirectories. Similarly, a directory | ||
| 1189 | cannot be marked with this command if any file in its tree is marked. | ||
| 1190 | |||
| 1191 | @item M | ||
| 1192 | If point is on a file entry, mark all files with the same status; if | ||
| 1193 | point is on a directory entry, mark all files in that directory tree | ||
| 1194 | (@code{vc-dir-mark-all-files}). With a prefix argument, mark all | ||
| 1195 | listed files and directories. | ||
| 1196 | |||
| 1197 | @item u | ||
| 1198 | Unmark the file or directory on the current line. If the region is | ||
| 1199 | active, unmark all the files in the region (@code{vc-dir-unmark}). | ||
| 1200 | |||
| 1201 | @item U | ||
| 1202 | If point is on a file entry, umark all files with the same status; if | ||
| 1203 | point is on a directory entry, unmark all files in that directory tree | ||
| 1204 | (@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all | ||
| 1170 | files and directories. | 1205 | files and directories. |
| 1171 | 1206 | ||
| 1172 | It is possible to do search, search and replace, incremental search, | 1207 | @item x |
| 1173 | and incremental regexp search on multiple files. These commands will | 1208 | Hide files with @samp{up-to-date} status |
| 1174 | work on all the marked files or the current file if nothing is marked. | 1209 | (@code{vc-dir-hide-up-to-date}). |
| 1175 | If a directory is marked, the files in that directory shown in the VC | 1210 | |
| 1176 | directory buffer will be used. | 1211 | @item q |
| 1212 | Quit the VC Directory buffer, and bury it (@code{quit-window}). | ||
| 1213 | @end table | ||
| 1214 | |||
| 1215 | @findex vc-dir-mark | ||
| 1216 | @findex vc-dir-mark-all-files | ||
| 1217 | While in the VC Directory buffer, all the files that you mark with | ||
| 1218 | @kbd{m} (@code{vc-dir-mark}) or @kbd{M} (@code{vc-dir-mark}) are in | ||
| 1219 | the current VC fileset. If you mark a directory entry with @kbd{m}, | ||
| 1220 | all the listed files in that directory tree are in the current VC | ||
| 1221 | fileset. The files and directories that belong to the current VC | ||
| 1222 | fileset are indicated with a @samp{*} character in the VC Directory | ||
| 1223 | buffer, next to their VC status. In this way, you can set up a | ||
| 1224 | multi-file VC fileset to be acted on by VC commands like @w{@kbd{C-x v | ||
| 1225 | v}} (@pxref{Basic VC Editing}), @w{@kbd{C-x v =}} (@pxref{Old | ||
| 1226 | Revisions}), and @w{@kbd{C-x v u}} (@pxref{VC Undo}). | ||
| 1227 | |||
| 1228 | The VC Directory buffer also defines some single-key shortcuts for | ||
| 1229 | VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l}, | ||
| 1230 | @kbd{i}, and @kbd{v}. | ||
| 1231 | |||
| 1232 | For example, you can commit a set of edited files by opening a VC | ||
| 1233 | Directory buffer, where the files are listed with the @samp{edited} | ||
| 1234 | status; marking the files; and typing @kbd{v} or @kbd{C-x v v} | ||
| 1235 | (@code{vc-next-action}). If the version control system is | ||
| 1236 | changeset-based, Emacs will commit the files in a single revision. | ||
| 1237 | |||
| 1238 | While in the VC Directory buffer, you can also perform search and | ||
| 1239 | replace on the current VC fileset, with the following commands: | ||
| 1177 | 1240 | ||
| 1178 | @kbd{S} searches the marked files. | 1241 | @table @kbd |
| 1242 | @item S | ||
| 1243 | Search the fileset (@code{vc-dir-search}). | ||
| 1244 | |||
| 1245 | @item Q | ||
| 1246 | Do a regular expression query replace on the fileset | ||
| 1247 | (@code{vc-dir-query-replace-regexp}). | ||
| 1179 | 1248 | ||
| 1180 | @kbd{Q} does a query replace on the marked files. | 1249 | @item M-s a C-s |
| 1250 | Do an incremental search on the fileset (@code{vc-dir-isearch}). | ||
| 1181 | 1251 | ||
| 1182 | @kbd{M-s a C-s} does an incremental search on the marked files. | 1252 | @item M-s a C-M-s |
| 1253 | Do an incremental regular expression search on the fileset | ||
| 1254 | (@code{vc-dir-isearch-regexp}). | ||
| 1255 | @end table | ||
| 1183 | 1256 | ||
| 1184 | @kbd{M-s a C-M-s} does an incremental regular expression search | 1257 | @noindent |
| 1185 | on the marked files. | 1258 | Apart from acting on multiple files, these commands behave much like |
| 1259 | their single-buffer counterparts (@pxref{Search}). | ||
| 1186 | 1260 | ||
| 1187 | @cindex stashes in version control | 1261 | @cindex stashes in version control |
| 1188 | @cindex shelves in version control | 1262 | @cindex shelves in version control |
| 1189 | Commands are also accessible from the VC-dir menu. Note that some | 1263 | The above commands are also available via the menu bar, and via a |
| 1190 | VC backends use the VC-dir menu to make available extra, | 1264 | context menu invoked by @kbd{Mouse-2}. Furthermore, some VC backends |
| 1191 | backend-specific, commands. For example, Git and Bazaar allow you to | 1265 | use the menu to provide extra backend-specific commands. For example, |
| 1192 | manipulate @dfn{stashes} and @dfn{shelves}. (These provide a | 1266 | Git and Bazaar allow you to manipulate @dfn{stashes} and @dfn{shelves} |
| 1193 | mechanism to temporarily store uncommitted changes somewhere out of | 1267 | (where are a way to temporarily put aside uncommitted changes, and |
| 1194 | the way, and bring them back at a later time.) | 1268 | bring them back at a later time). |
| 1195 | |||
| 1196 | Normal VC commands with the @kbd{C-x v} prefix work in VC directory | ||
| 1197 | buffers. Some single-key shortcuts are available as well; @kbd{=}, | ||
| 1198 | @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with | ||
| 1199 | @kbd{C-x v}. | ||
| 1200 | |||
| 1201 | The command @kbd{C-x v v} (@code{vc-next-action}) operates on all | ||
| 1202 | the marked files, so that you can commit several files at once. If | ||
| 1203 | the underlying VC supports atomic commits of multiple-file changesets, | ||
| 1204 | @kbd{C-x v v} with a selected set of modified but not committed files | ||
| 1205 | will commit all of them at once as a single changeset. | ||
| 1206 | |||
| 1207 | When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple | ||
| 1208 | files, all of those files must be either in the same state or in | ||
| 1209 | compatible states (added, modified and removed states are considered | ||
| 1210 | compatible). Otherwise it signals an error. This differs from the | ||
| 1211 | behavior of older versions of VC, which did not have fileset | ||
| 1212 | operations and simply did @code{vc-next-action} on each file | ||
| 1213 | individually. | ||
| 1214 | |||
| 1215 | If any files are in a state that calls for commit, @kbd{C-x v v} reads a | ||
| 1216 | single log entry and uses it for the changeset as a whole. If the | ||
| 1217 | underling VCS is file- rather than changeset-oriented, the log entry | ||
| 1218 | will be replicated into the history of each file. | ||
| 1219 | 1269 | ||
| 1220 | @node Branches | 1270 | @node Branches |
| 1221 | @subsection Multiple Branches of a File | 1271 | @subsection Multiple Branches of a File |
| @@ -849,6 +849,7 @@ the user for specifics, e.g. a merge source. | |||
| 849 | 849 | ||
| 850 | **** Currently supported for Bzr, Git, and Mercurial. | 850 | **** Currently supported for Bzr, Git, and Mercurial. |
| 851 | 851 | ||
| 852 | +++ | ||
| 852 | *** New option `vc-revert-show-diff' controls whether `vc-revert' | 853 | *** New option `vc-revert-show-diff' controls whether `vc-revert' |
| 853 | shows a diff while querying the user. It defaults to t. | 854 | shows a diff while querying the user. It defaults to t. |
| 854 | 855 | ||