diff options
| author | Chong Yidong | 2011-12-17 15:50:08 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-12-17 15:50:08 +0800 |
| commit | 9cff91f800cc72f8c77cf192c119c78d4a14a8ee (patch) | |
| tree | 5f023ede7134cbcb1a1b69efe38750dcb6c80134 | |
| parent | 301b181a14b0f698c6aae05522e6f3401ea45a3c (diff) | |
| download | emacs-9cff91f800cc72f8c77cf192c119c78d4a14a8ee.tar.gz emacs-9cff91f800cc72f8c77cf192c119c78d4a14a8ee.zip | |
More updates for VC documentation.
* doc/emacs/maintaining.texi (VCS Concepts): Make "revision" terminology
less CVS-specific.
(VC With A Merging VCS, VC With A Locking VCS): Add xref to
Registering node.
(Secondary VC Commands): Deleted. Promote subnodes.
(Log Buffer): Add command name for C-c C-c. Fix the name of the
log buffer. Add index entries.
(VCS Changesets, Types of Log File, VC With A Merging VCS): Use
"commit" terminology.
(Old Revisions): Move it to just before VC Change Log. "Tag" here
doesn't refer to tags tables. Note other possible forms of the
revision ID. C-x v = does not save.
(Registering): Note similarity to C-x v v action. Fix description
of how backends are chosen. De-document vc-default-init-revision.
(VC Change Log): Document C-x v l in VC-Dir buffer. Document RET
in root log buffers.
* lisp/vc/vc.el (vc-deduce-fileset): Minor doc fix.
| -rw-r--r-- | doc/emacs/ChangeLog | 19 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 12 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 587 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 12 |
6 files changed, 318 insertions, 317 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 412a9cd5a58..20f068e4ef6 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2011-12-17 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * maintaining.texi (VCS Concepts): Make "revision" terminology | ||
| 4 | less CVS-specific. | ||
| 5 | (VC With A Merging VCS, VC With A Locking VCS): Add xref to | ||
| 6 | Registering node. | ||
| 7 | (Secondary VC Commands): Deleted. Promote subnodes. | ||
| 8 | (Log Buffer): Add command name for C-c C-c. Fix the name of the | ||
| 9 | log buffer. Add index entries. | ||
| 10 | (VCS Changesets, Types of Log File, VC With A Merging VCS): Use | ||
| 11 | "commit" terminology. | ||
| 12 | (Old Revisions): Move it to just before VC Change Log. "Tag" here | ||
| 13 | doesn't refer to tags tables. Note other possible forms of the | ||
| 14 | revision ID. C-x v = does not save. | ||
| 15 | (Registering): Note similarity to C-x v v action. Fix description | ||
| 16 | of how backends are chosen. De-document vc-default-init-revision. | ||
| 17 | (VC Change Log): Document C-x v l in VC-Dir buffer. Document RET | ||
| 18 | in root log buffers. | ||
| 19 | |||
| 1 | 2011-12-16 Chong Yidong <cyd@gnu.org> | 20 | 2011-12-16 Chong Yidong <cyd@gnu.org> |
| 2 | 21 | ||
| 3 | * maintaining.texi (Version Control Systems): Drop Meta-CVS. | 22 | * maintaining.texi (Version Control Systems): Drop Meta-CVS. |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 2cb02feee60..3a93889f6c7 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -741,15 +741,17 @@ Version Control | |||
| 741 | * VC Mode Line:: How the mode line shows version control status. | 741 | * VC Mode Line:: How the mode line shows version control status. |
| 742 | * Basic VC Editing:: How to edit a file under version control. | 742 | * Basic VC Editing:: How to edit a file under version control. |
| 743 | * Log Buffer:: Features available in log entry buffers. | 743 | * Log Buffer:: Features available in log entry buffers. |
| 744 | * Registering:: Putting a file under version control. | ||
| 744 | * Old Revisions:: Examining and comparing old versions. | 745 | * Old Revisions:: Examining and comparing old versions. |
| 745 | * Secondary VC Commands:: The commands used a little less frequently. | 746 | * VC Change Log:: Viewing the VC Change Log. |
| 747 | * VC Undo:: Canceling changes before or after committing. | ||
| 746 | * VC Directory Mode:: Listing files managed by version control. | 748 | * VC Directory Mode:: Listing files managed by version control. |
| 747 | * Branches:: Multiple lines of development. | 749 | * Branches:: Multiple lines of development. |
| 748 | * Remote Repositories:: Efficient access to remote CVS servers. | 750 | * Remote Repositories:: Efficient access to remote CVS servers. |
| 749 | * Revision Tags:: Symbolic names for revisions. | 751 | * Revision Tags:: Symbolic names for revisions. |
| 750 | * Miscellaneous VC:: Various other commands and features of VC. | 752 | * Miscellaneous VC:: Various other commands and features of VC. |
| 751 | * Customizing VC:: Variables that change VC's behavior. | 753 | * Customizing VC:: Variables that change VC's behavior. |
| 752 | 754 | ||
| 753 | Introduction to Version Control | 755 | Introduction to Version Control |
| 754 | 756 | ||
| 755 | * Why Version Control?:: Understanding the problems it addresses. | 757 | * Why Version Control?:: Understanding the problems it addresses. |
| @@ -766,12 +768,6 @@ Basic Editing under Version Control | |||
| 766 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. | 768 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. |
| 767 | * Advanced C-x v v:: Advanced features available with a prefix argument. | 769 | * Advanced C-x v v:: Advanced features available with a prefix argument. |
| 768 | 770 | ||
| 769 | The Secondary Commands of VC | ||
| 770 | |||
| 771 | * Registering:: Putting a file under version control. | ||
| 772 | * VC Change Log:: Viewing the VC Change Log. | ||
| 773 | * VC Undo:: Canceling changes before or after check-in. | ||
| 774 | |||
| 775 | VC Directory Mode | 771 | VC Directory Mode |
| 776 | 772 | ||
| 777 | * VC Directory Buffer:: What the buffer looks like and means. | 773 | * VC Directory Buffer:: What the buffer looks like and means. |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 9d788fa7192..063d0e65f5b 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -49,8 +49,10 @@ variable @code{vc-handled-backends} to @code{nil} | |||
| 49 | * VC Mode Line:: How the mode line shows version control status. | 49 | * VC Mode Line:: How the mode line shows version control status. |
| 50 | * Basic VC Editing:: How to edit a file under version control. | 50 | * Basic VC Editing:: How to edit a file under version control. |
| 51 | * Log Buffer:: Features available in log entry buffers. | 51 | * Log Buffer:: Features available in log entry buffers. |
| 52 | * Registering:: Putting a file under version control. | ||
| 52 | * Old Revisions:: Examining and comparing old versions. | 53 | * Old Revisions:: Examining and comparing old versions. |
| 53 | * Secondary VC Commands:: The commands used a little less frequently. | 54 | * VC Change Log:: Viewing the VC Change Log. |
| 55 | * VC Undo:: Canceling changes before or after committing. | ||
| 54 | * VC Directory Mode:: Listing files managed by version control. | 56 | * VC Directory Mode:: Listing files managed by version control. |
| 55 | * Branches:: Multiple lines of development. | 57 | * Branches:: Multiple lines of development. |
| 56 | @ifnottex | 58 | @ifnottex |
| @@ -171,14 +173,14 @@ under active development, and has been deprecated in favor of Bazaar. | |||
| 171 | @item | 173 | @item |
| 172 | Git is a distributed version control system originally invented by | 174 | Git is a distributed version control system originally invented by |
| 173 | Linus Torvalds to support development of Linux (his kernel). VC | 175 | Linus Torvalds to support development of Linux (his kernel). VC |
| 174 | supports many common git operations, but others, such as repository | 176 | supports many common Git operations, but others, such as repository |
| 175 | syncing, must be done from the command line. | 177 | syncing, must be done from the command line. |
| 176 | 178 | ||
| 177 | @cindex hg | 179 | @cindex hg |
| 178 | @cindex Mercurial | 180 | @cindex Mercurial |
| 179 | @item | 181 | @item |
| 180 | Mercurial (hg) is a distributed version control system broadly | 182 | Mercurial (hg) is a distributed version control system broadly |
| 181 | resembling git. VC supports most Mercurial commands, with the | 183 | resembling Git. VC supports most Mercurial commands, with the |
| 182 | exception of repository sync operations. | 184 | exception of repository sync operations. |
| 183 | 185 | ||
| 184 | @cindex bzr | 186 | @cindex bzr |
| @@ -206,16 +208,16 @@ as @dfn{log entries} that describe the changes made to each file. | |||
| 206 | The copy of a version-controlled file that you actually edit is | 208 | The copy of a version-controlled file that you actually edit is |
| 207 | called the @dfn{work file}. You can change each work file as you | 209 | called the @dfn{work file}. You can change each work file as you |
| 208 | would an ordinary file. After you are done with a set of changes, you | 210 | would an ordinary file. After you are done with a set of changes, you |
| 209 | @dfn{commit} (or @dfn{check in}) the changes; this records the changes | 211 | may @dfn{commit} (or @dfn{check in}) the changes; this records the |
| 210 | in the repository, along with a descriptive log entry. | 212 | changes in the repository, along with a descriptive log entry. |
| 211 | 213 | ||
| 212 | @cindex revision | 214 | @cindex revision |
| 213 | @cindex revision ID | 215 | @cindex revision ID |
| 214 | A copy of a file stored in a repository is called a @dfn{revision}. | 216 | Each commit creates a new @dfn{revision} in the repository. The |
| 215 | The history of a file is a sequence of revisions. Each revision is | 217 | version control system keeps track of all past revisions and the |
| 216 | named by a @dfn{revision ID}. The format of the revision ID depends | 218 | changes that were made in each revision. Each revision is named by a |
| 217 | on the version control system; in the simplest case, it is just an | 219 | @dfn{revision ID}, whose format depends on the version control system; |
| 218 | integer. | 220 | in the simplest case, it is just an integer. |
| 219 | 221 | ||
| 220 | To go beyond these basic concepts, you will need to understand three | 222 | To go beyond these basic concepts, you will need to understand three |
| 221 | aspects in which version control systems differ. As explained in the | 223 | aspects in which version control systems differ. As explained in the |
| @@ -231,10 +233,10 @@ these modes of operation, but it cannot hide the differences. | |||
| 231 | between users who want to change the same file. There are two ways to | 233 | between users who want to change the same file. There are two ways to |
| 232 | do this: merging and locking. | 234 | do this: merging and locking. |
| 233 | 235 | ||
| 234 | In a version control system that uses merging, each user may check | 236 | In a version control system that uses merging, each user may modify |
| 235 | out and modify a work file at any time. The system lets you | 237 | a work file at any time. The system lets you @dfn{merge} your work |
| 236 | @dfn{merge} your work file, which may contain changes that have not | 238 | file, which may contain changes that have not been committed, with the |
| 237 | been committed, with the latest changes that others have committed. | 239 | latest changes that others have committed. |
| 238 | 240 | ||
| 239 | Older version control systems use a @dfn{locking} scheme instead. | 241 | Older version control systems use a @dfn{locking} scheme instead. |
| 240 | Here, work files are normally read-only. To edit a file, you ask the | 242 | Here, work files are normally read-only. To edit a file, you ask the |
| @@ -277,7 +279,7 @@ possible. | |||
| 277 | control operations are @dfn{file-based}: each file has its own comment | 279 | control operations are @dfn{file-based}: each file has its own comment |
| 278 | and revision history separate from that of all other files. Newer | 280 | and revision history separate from that of all other files. Newer |
| 279 | systems, beginning with Subversion, are @dfn{changeset-based}: a | 281 | systems, beginning with Subversion, are @dfn{changeset-based}: a |
| 280 | checkin may include changes to several files, and the entire set of | 282 | commit may include changes to several files, and the entire set of |
| 281 | changes is handled as a unit. Any comment associated with the change | 283 | changes is handled as a unit. Any comment associated with the change |
| 282 | does not belong to a single file, but to the changeset itself. | 284 | does not belong to a single file, but to the changeset itself. |
| 283 | 285 | ||
| @@ -342,10 +344,9 @@ policy, which you should follow. | |||
| 342 | When the policy is to use both, you typically want to write an entry | 344 | When the policy is to use both, you typically want to write an entry |
| 343 | for each change just once, then put it into both logs. You can write | 345 | for each change just once, then put it into both logs. You can write |
| 344 | the entry in @file{ChangeLog}, then copy it to the log buffer with | 346 | the entry in @file{ChangeLog}, then copy it to the log buffer with |
| 345 | @kbd{C-c C-a} when checking in the change (@pxref{Log Buffer}). Or | 347 | @kbd{C-c C-a} when committing the change (@pxref{Log Buffer}). Or you |
| 346 | you can write the entry in the log buffer while checking in the | 348 | can write the entry in the log buffer while committing the change, and |
| 347 | change, and later use the @kbd{C-x v a} command to copy it to | 349 | later use the @kbd{C-x v a} command to copy it to @file{ChangeLog} |
| 348 | @file{ChangeLog} | ||
| 349 | @iftex | 350 | @iftex |
| 350 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). | 351 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). |
| 351 | @end iftex | 352 | @end iftex |
| @@ -450,23 +451,25 @@ and don't persist across sessions. | |||
| 450 | @itemize @bullet | 451 | @itemize @bullet |
| 451 | @item | 452 | @item |
| 452 | If there is more than one file in the VC fileset and the files have | 453 | If there is more than one file in the VC fileset and the files have |
| 453 | inconsistent version control states, signal an error. | 454 | inconsistent version control states, signal an error. (Note, however, |
| 455 | that a fileset is allowed to include both ``newly-added'' files and | ||
| 456 | ``modified'' files; @pxref{Registering}.) | ||
| 454 | 457 | ||
| 455 | @item | 458 | @item |
| 456 | If each file in the VC fileset is not registered with a version | 459 | If none of the files in the VC fileset are registered with a version |
| 457 | control system, register the VC fileset. If the fileset is in a | 460 | control system, register the VC fileset, i.e.@: place it under version |
| 458 | directory controlled by a version control system, register it with | 461 | control. @xref{Registering}. If Emacs cannot find a system to |
| 459 | that system; otherwise, prompt for a repository type, create a new | 462 | register under, it prompts for a repository type, creates a new |
| 460 | repository, and register the VC fileset with it. | 463 | repository, and registers the VC fileset with it. |
| 461 | 464 | ||
| 462 | @item | 465 | @item |
| 463 | If each work file in the VC fileset is unchanged, do nothing. | 466 | If every work file in the VC fileset is unchanged, do nothing. |
| 464 | 467 | ||
| 465 | @item | 468 | @item |
| 466 | If each work file in the VC fileset has been modified, commit the | 469 | If every work file in the VC fileset has been modified, commit the |
| 467 | changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the | 470 | changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the |
| 468 | desired log entry for the new revision, followed by @kbd{C-c C-c} to | 471 | desired log entry for the new revision, followed by @kbd{C-c C-c} to |
| 469 | commit (@pxref{Log Buffer}). | 472 | commit. @xref{Log Buffer}. |
| 470 | 473 | ||
| 471 | If committing to a shared repository, the commit may fail if the | 474 | If committing to a shared repository, the commit may fail if the |
| 472 | repository that has been changed since your last update. In that | 475 | repository that has been changed since your last update. In that |
| @@ -487,7 +490,7 @@ Nothing informs you if another user has committed changes in the same | |||
| 487 | file since you began editing it; when you commit your revision, his | 490 | file since you began editing it; when you commit your revision, his |
| 488 | changes are removed (however, they remain in the repository and are | 491 | changes are removed (however, they remain in the repository and are |
| 489 | thus not irrevocably lost). Therefore, you must verify that the | 492 | thus not irrevocably lost). Therefore, you must verify that the |
| 490 | current revision is unchanged before checking in your changes. In | 493 | current revision is unchanged before committing your changes. In |
| 491 | addition, locking is possible with RCS even in this mode: @kbd{C-x v | 494 | addition, locking is possible with RCS even in this mode: @kbd{C-x v |
| 492 | v} with an unmodified file locks the file, just as it does with RCS in | 495 | v} with an unmodified file locks the file, just as it does with RCS in |
| 493 | its normal locking mode (@pxref{VC With A Locking VCS}). | 496 | its normal locking mode (@pxref{VC With A Locking VCS}). |
| @@ -505,10 +508,10 @@ inconsistent version control states, signal an error. | |||
| 505 | 508 | ||
| 506 | @item | 509 | @item |
| 507 | If each file in the VC fileset is not registered with a version | 510 | If each file in the VC fileset is not registered with a version |
| 508 | control system, register the VC fileset. If the fileset is in a | 511 | control system, register the VC fileset. @xref{Registering}. If |
| 509 | directory controlled by a version control system, register it with | 512 | Emacs cannot find a system to register under, it prompts for a |
| 510 | that system; otherwise, prompt for a repository type, create a new | 513 | repository type, creates a new repository, and registers the VC |
| 511 | repository, and register the VC fileset with it. | 514 | fileset with it. |
| 512 | 515 | ||
| 513 | @item | 516 | @item |
| 514 | If each file is registered and unlocked, lock it and make it writable, | 517 | If each file is registered and unlocked, lock it and make it writable, |
| @@ -575,13 +578,23 @@ Features}). | |||
| 575 | @node Log Buffer | 578 | @node Log Buffer |
| 576 | @subsection Features of the Log Entry Buffer | 579 | @subsection Features of the Log Entry Buffer |
| 577 | 580 | ||
| 578 | When you tell VC to commit a change, it pops up a buffer called | 581 | @cindex C-c C-c @r{(Log Edit mode)} |
| 579 | @samp{*VC-Log*}. In this buffer, you should write a @dfn{log entry} | 582 | @findex log-edit-done |
| 583 | When you tell VC to commit a change, it pops up a buffer named | ||
| 584 | @samp{*vc-log*}. In this buffer, you should write a @dfn{log entry} | ||
| 580 | describing the changes you have made (@pxref{Why Version Control?}). | 585 | describing the changes you have made (@pxref{Why Version Control?}). |
| 581 | After you are done, type @kbd{C-c C-c}; this exits the buffer and | 586 | After you are done, type @kbd{C-c C-c} (@code{log-edit-done}) to exit |
| 582 | commits the change, together with your log entry. | 587 | the buffer and commit the change, together with your log entry. |
| 583 | 588 | ||
| 584 | While in the @samp{*VC-Log*} buffer, you can write one or more | 589 | @cindex Log Edit mode |
| 590 | @cindex mode, Log Edit | ||
| 591 | @vindex vc-log-mode-hook | ||
| 592 | The major mode for the @samp{*vc-log*} buffer is Log Edit mode, a | ||
| 593 | variant of Text mode (@pxref{Text Mode}). On entering Log Edit mode, | ||
| 594 | Emacs runs the hooks @code{text-mode-hook} and @code{vc-log-mode-hook} | ||
| 595 | (@pxref{Hooks}). | ||
| 596 | |||
| 597 | While in the @samp{*vc-log*} buffer, you can write one or more | ||
| 585 | @dfn{header lines}, specifying additional information to be supplied | 598 | @dfn{header lines}, specifying additional information to be supplied |
| 586 | to the version control system. Each header line must occupy a single | 599 | to the version control system. Each header line must occupy a single |
| 587 | line at the top of the buffer; the first line that is not a header | 600 | line at the top of the buffer; the first line that is not a header |
| @@ -598,196 +611,224 @@ Apart from the @samp{Author} header, Emacs recognizes the headers | |||
| 598 | @samp{Date} (a manually-specified commit time) and @samp{Fixes} (a | 611 | @samp{Date} (a manually-specified commit time) and @samp{Fixes} (a |
| 599 | reference to a bug fixed by the change). Not all version control | 612 | reference to a bug fixed by the change). Not all version control |
| 600 | systems recognize all headers: Bazaar recognizes all three headers, | 613 | systems recognize all headers: Bazaar recognizes all three headers, |
| 601 | while git, Mercurial, and Monotone recognizes only @samp{Author} and | 614 | while Git, Mercurial, and Monotone recognize only @samp{Author} and |
| 602 | @samp{Summary}. If you specify a header for a version control that | 615 | @samp{Date}. If you specify a header for a version control that does |
| 603 | does not support it, the header is treated as part of the log entry. | 616 | not support it, the header is treated as part of the log entry. |
| 604 | 617 | ||
| 618 | @kindex C-c C-f @r{(Log Edit mode)} | ||
| 605 | @findex log-edit-show-files | 619 | @findex log-edit-show-files |
| 620 | Type @kbd{C-c C-f} (@code{log-edit-show-files}) in the | ||
| 621 | @samp{*vc-log*} buffer to view a list of files for the VC fileset that | ||
| 622 | is to be committed. If you called @kbd{C-x v v} directly from a work | ||
| 623 | file, the fileset consists of that single file. If you called | ||
| 624 | @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory Mode}), | ||
| 625 | the fileset may consist of multiple files; in that case, @kbd{C-c C-c} | ||
| 626 | will commit those files together, as a single revision, if that is | ||
| 627 | supported by the version control system (on older version control | ||
| 628 | systems, such as CVS, each file in a multi-file VC fileset is | ||
| 629 | committed as an individual revision). | ||
| 630 | |||
| 631 | @kindex C-c C-d @r{(Log Edit mode)} | ||
| 606 | @findex log-edit-show-diff | 632 | @findex log-edit-show-diff |
| 607 | Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of | ||
| 608 | files in the current VC fileset. If you called @kbd{C-x v v} directly | ||
| 609 | from a work file, the fileset consists of that single file; if you | ||
| 610 | called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory | ||
| 611 | Mode}), the fileset may consist of multiple files. | ||
| 612 | |||
| 613 | @findex log-edit-insert-changelog | ||
| 614 | Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff} | 633 | Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff} |
| 615 | of the changes you have made (i.e., the differences between the work | 634 | of the changes between the current VC fileset and the repository |
| 616 | file and the repository revision from which you started editing). | 635 | revision from which you started editing. @xref{Old Revisions}. |
| 617 | @xref{Old Revisions}. | ||
| 618 | 636 | ||
| 619 | If the current VC fileset includes one or more @file{ChangeLog} | 637 | @kindex C-c C-a @r{(Log Edit mode)} |
| 620 | files (@pxref{Change Log}), type @kbd{C-c C-a} | 638 | @findex log-edit-insert-changelog |
| 639 | If the VC fileset that is to be committed includes one or more | ||
| 640 | @file{ChangeLog} files (@pxref{Change Log}), type @kbd{C-c C-a} | ||
| 621 | (@code{log-edit-insert-changelog}) to pull the relevant entries into | 641 | (@code{log-edit-insert-changelog}) to pull the relevant entries into |
| 622 | the @samp{*VC-Log*} buffer. If the topmost item in each | 642 | the @samp{*vc-log*} buffer. If the topmost item in each |
| 623 | @file{ChangeLog} was made under your user name on the current date, | 643 | @file{ChangeLog} was made under your user name on the current date, |
| 624 | this command searches that item for entries that match the file(s) to | 644 | this command searches that item for entries matching the file(s) to be |
| 625 | be committed; if found, these entries are inserted. | 645 | committed, and inserts them. |
| 626 | @iftex | ||
| 627 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, | ||
| 628 | @end iftex | ||
| 629 | @ifnottex | 646 | @ifnottex |
| 630 | @xref{Change Logs and VC}, | 647 | @xref{Change Logs and VC}, for the opposite way of |
| 648 | working---generating ChangeLog entries from the revision control log. | ||
| 631 | @end ifnottex | 649 | @end ifnottex |
| 632 | for the opposite way of working---generating ChangeLog entries from | ||
| 633 | the revision control log. | ||
| 634 | 650 | ||
| 635 | To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that | 651 | To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that |
| 636 | buffer. You can switch buffers and do other editing. As long as you | 652 | buffer. You can switch buffers and do other editing. As long as you |
| 637 | don't try to commit another file, the entry you were editing remains | 653 | don't try to make another commit, the entry you were editing remains |
| 638 | in the @samp{*VC-Log*} buffer, and you can go back to that buffer at | 654 | in the @samp{*vc-log*} buffer, and you can go back to that buffer at |
| 639 | any time to complete the check-in. | 655 | any time to complete the commit. |
| 640 | 656 | ||
| 641 | If you change several source files for the same reason, it is often | 657 | @kindex M-n @r{(Log Edit mode)} |
| 642 | convenient to specify the same log entry for many of the files. (This | 658 | @kindex M-p @r{(Log Edit mode)} |
| 643 | is the normal way to do things on a changeset-oriented system, where | 659 | @kindex M-s @r{(Log Edit mode)} |
| 644 | comments are attached to changesets rather than the history of | 660 | @kindex M-r @r{(Log Edit mode)} |
| 645 | individual files.) The most convenient way to do this is to mark all | ||
| 646 | the files in VC Directory Mode and commit from there; the log buffer | ||
| 647 | will carry the fileset information with it and do a group commit when | ||
| 648 | you type @kbd{C-c C-c}. | ||
| 649 | |||
| 650 | You can also browse the history of previous log entries to duplicate | 661 | You can also browse the history of previous log entries to duplicate |
| 651 | a checkin comment. This can be useful when you want several files to | 662 | a commit comment. This can be useful when you want to make several |
| 652 | have checkin comments that vary only slightly from each other. The | 663 | commits with similar comments. The commands @kbd{M-n}, @kbd{M-p}, |
| 653 | commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this | 664 | @kbd{M-s} and @kbd{M-r} for doing this work just like the minibuffer |
| 654 | work just like the minibuffer history commands (except that these | 665 | history commands (@pxref{Minibuffer History}), except that they are |
| 655 | versions are used outside the minibuffer). | 666 | used outside the minibuffer. |
| 656 | 667 | ||
| 657 | @vindex vc-log-mode-hook | 668 | @node Registering |
| 658 | Each time you commit a change, the log entry buffer is put into VC | 669 | @subsection Registering a File for Version Control |
| 659 | Log Edit mode, which involves running two hooks: @code{text-mode-hook} | 670 | |
| 660 | and @code{vc-log-mode-hook}. @xref{Hooks}. | 671 | @table @kbd |
| 672 | @item C-x v i | ||
| 673 | Register the visited file for version control. | ||
| 674 | @end table | ||
| 675 | |||
| 676 | @kindex C-x v i | ||
| 677 | @findex vc-register | ||
| 678 | The command @kbd{C-x v i} (@code{vc-register}) @dfn{registers} each | ||
| 679 | file in the current VC fileset, placing it under version control. | ||
| 680 | This is essentially equivalent to the action of @kbd{C-x v v} on an | ||
| 681 | unregistered VC fileset (@pxref{Basic VC Editing}), except that if the | ||
| 682 | VC fileset is already registered, @kbd{C-x v i} signals an error | ||
| 683 | whereas @kbd{C-x v v} performs some other action. | ||
| 684 | |||
| 685 | To register a file, Emacs must choose a version control system. For | ||
| 686 | a multi-file VC fileset, the VC Directory buffer specifies the system | ||
| 687 | to use (@pxref{VC Directory Mode}). For a single-file VC fileset, if | ||
| 688 | the file's directory already contains files registered in a version | ||
| 689 | control system, or if the directory is part of a directory tree | ||
| 690 | controlled by a version control system, Emacs chooses that system. In | ||
| 691 | the event that more than one version control system is applicable, | ||
| 692 | Emacs uses the one that appears first in the variable | ||
| 693 | @iftex | ||
| 694 | @code{vc-handled-backends}. | ||
| 695 | @end iftex | ||
| 696 | @ifnottex | ||
| 697 | @code{vc-handled-backends} (@pxref{Customizing VC}). | ||
| 698 | @end ifnottex | ||
| 699 | If Emacs cannot find a version control system to register the file | ||
| 700 | under, it prompts for a repository type, creates a new repository, and | ||
| 701 | registers the file into that repository. | ||
| 702 | |||
| 703 | On most version control systems, registering a file with @kbd{C-x v | ||
| 704 | i} or @kbd{C-x v v} adds it to the ``working tree'' but not to the | ||
| 705 | repository. Such files are labeled as @samp{added} in the VC | ||
| 706 | Directory buffer, and show a revision ID of @samp{@@@@} in the mode | ||
| 707 | line. To make the registration take effect in the repository, you | ||
| 708 | must perform a commit (@pxref{Basic VC Editing}). Note that on | ||
| 709 | changeset-based version control systems, commits can consist of both | ||
| 710 | file additions and modifications. | ||
| 711 | |||
| 712 | On a locking-based version control system (@pxref{VCS Merging}), | ||
| 713 | registering a file leaves it unlocked and read-only. Type @kbd{C-x v | ||
| 714 | v} if you wish to start editing it. | ||
| 661 | 715 | ||
| 662 | @node Old Revisions | 716 | @node Old Revisions |
| 663 | @subsection Examining And Comparing Old Revisions | 717 | @subsection Examining And Comparing Old Revisions |
| 664 | 718 | ||
| 665 | One of the convenient features of version control is the ability | ||
| 666 | to examine any revision of a file, or compare two revisions. | ||
| 667 | |||
| 668 | @table @kbd | 719 | @table @kbd |
| 669 | @item C-x v ~ | ||
| 670 | Prompt for a revision of the current file, and visit it in a buffer of | ||
| 671 | its own (@code{vc-revision-other-window}). | ||
| 672 | |||
| 673 | @item C-x v = | 720 | @item C-x v = |
| 674 | Compare the files in the current fileset with the working revision(s) | 721 | Compare the work files in the current VC fileset with the versions you |
| 675 | you started from (@code{vc-diff}). With a prefix argument, prompt for | 722 | started from (@code{vc-diff}). With a prefix argument, prompt for two |
| 676 | two revisions of the current fileset and compare them. You can call | 723 | revisions of the current VC fileset and compare them. You can also |
| 677 | this command from a Dired buffer (@pxref{Dired}). | 724 | call this command from a Dired buffer (@pxref{Dired}). |
| 725 | |||
| 726 | @ifnottex | ||
| 727 | @item M-x vc-ediff | ||
| 728 | Like @kbd{C-x v =}, but using an Ediff session. @xref{Top, Ediff, | ||
| 729 | ediff, The Ediff Manual}. | ||
| 730 | @end ifnottex | ||
| 678 | 731 | ||
| 679 | @item C-x v D | 732 | @item C-x v D |
| 680 | Compare the entire tree corresponding to the current fileset with the | 733 | Compare all work files in the current version controlled directory |
| 681 | tree you started from (@code{vc-root-diff}). With a prefix argument, | 734 | tree to the tree you started from (@code{vc-root-diff}). With a |
| 682 | prompt for two revisions and compare their trees. | 735 | prefix argument, prompt for two revisions and compare their trees. |
| 736 | |||
| 737 | @item C-x v ~ | ||
| 738 | Prompt for a revision of the current file, and visit it in a separate | ||
| 739 | buffer (@code{vc-revision-other-window}). | ||
| 683 | 740 | ||
| 684 | @item C-x v g | 741 | @item C-x v g |
| 685 | Display an annotated version of the file: for each line, show the | 742 | Display an annotated version of the current file: for each line, show |
| 686 | latest revision in which it was modified (@code{vc-annotate}). | 743 | the latest revision in which it was modified (@code{vc-annotate}). |
| 687 | @end table | 744 | @end table |
| 688 | 745 | ||
| 689 | @findex vc-revision-other-window | ||
| 690 | @kindex C-x v ~ | ||
| 691 | To examine an old revision, visit the work file and type @kbd{C-x v | ||
| 692 | ~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). Here, | ||
| 693 | @var{revision} is either the desired revision ID (@pxref{VCS | ||
| 694 | Concepts}), or the name of a tag or branch | ||
| 695 | @iftex | ||
| 696 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). | ||
| 697 | @end iftex | ||
| 698 | @ifnottex | ||
| 699 | (@pxref{Tags}). | ||
| 700 | @end ifnottex | ||
| 701 | This command puts the text of the old revision in a file named | ||
| 702 | @file{@var{filename}.~@var{revision}~}, and visits it in its own | ||
| 703 | buffer in a separate window. | ||
| 704 | |||
| 705 | @findex vc-diff | 746 | @findex vc-diff |
| 706 | @kindex C-x v = | 747 | @kindex C-x v = |
| 707 | @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC | 748 | @kbd{C-x v =} (@code{vc-diff}) displays a @dfn{diff} which compares |
| 708 | fileset (saving them if necessary) with the repository revision(s) | 749 | each work file in the current VC fileset to the version(s) from which |
| 709 | from which you started editing. Note that the latter may or may not | 750 | you started editing. The diff is displayed in another window, in a |
| 710 | be the latest revision of the file(s). | 751 | Diff mode buffer (@pxref{Diff Mode}) named @file{*vc-diff*}. The |
| 711 | 752 | usual Diff mode commands are available in this buffer. In particular, | |
| 712 | The diff is displayed in another window, in a Diff mode buffer | 753 | the @kbd{g} (@code{revert-buffer}) command performs the file |
| 713 | (@pxref{Diff Mode}) named @file{*vc-diff*}. In this buffer, the | 754 | comparison again, generating a new diff. |
| 714 | @kbd{g} (@code{revert-buffer}) command performs the file comparison | ||
| 715 | again, generating a new diff. | ||
| 716 | 755 | ||
| 717 | @findex vc-diff | ||
| 718 | @kindex C-u C-x v = | 756 | @kindex C-u C-x v = |
| 719 | To compare two arbitrary revisions of the current VC fileset, call | 757 | To compare two arbitrary revisions of the current VC fileset, call |
| 720 | @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This | 758 | @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This |
| 721 | prompts for two revision IDs, using the minibuffer, and displays the | 759 | prompts for two revision IDs (@pxref{VCS Concepts}), and displays a |
| 722 | diff in a special buffer in another window. Instead of providing a | 760 | diff between those versions of the fileset. This will not work |
| 723 | revision ID, you can give an empty input, which specifies the current | 761 | reliably for multi-file VC filesets, if the version control system is |
| 724 | contents of the work file; or a tag or branch name | 762 | file-based rather than changeset-based (e.g.@: CVS), since then |
| 725 | @iftex | 763 | revision IDs for different files would not be related in any |
| 726 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). | 764 | meaningful way. |
| 727 | @end iftex | 765 | |
| 766 | Instead of the revision ID, some version control systems let you | ||
| 767 | specify revisions in other formats. For instance, under Bazaar you | ||
| 768 | can enter @samp{date:yesterday} for the argument to @kbd{C-u C-x v =} | ||
| 769 | (and related commands) to specify the first revision committed after | ||
| 770 | yesterday. See the documentation of the version control system for | ||
| 771 | details. | ||
| 772 | |||
| 773 | If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a Dired buffer | ||
| 774 | (@pxref{Dired}), the file listed on the current line is treated as the | ||
| 775 | current VC fileset. | ||
| 776 | |||
| 728 | @ifnottex | 777 | @ifnottex |
| 729 | (@pxref{Tags}). | 778 | @findex vc-ediff |
| 779 | @kbd{M-x vc-ediff} works like @kbd{C-x v =}, except that it uses an | ||
| 780 | Ediff session. @xref{Top, Ediff, ediff, The Ediff Manual}. | ||
| 730 | @end ifnottex | 781 | @end ifnottex |
| 731 | If your version control system is file-based (e.g. CVS) rather than | ||
| 732 | changeset-based (Subversion, GNU Arch, git, Mercurial), supplying a | ||
| 733 | revision ID for a multi-file fileset (as opposed to a symbolic tag | ||
| 734 | name) is unlikely to return diffs that are connected in any meaningful | ||
| 735 | way. | ||
| 736 | |||
| 737 | The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to | ||
| 738 | @kbd{C-x v =}, but it compares the entire tree associated with the | ||
| 739 | current VC fileset with the tree you started with. This means all the | ||
| 740 | files controlled by the current version control repository, even those | ||
| 741 | that are not part of the current VC fileset. | ||
| 742 | |||
| 743 | If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that | ||
| 744 | is neither visiting a version-controlled file nor a VC directory | ||
| 745 | buffer, these commands generate a diff of all registered files in the | ||
| 746 | current directory and its subdirectories. | ||
| 747 | 782 | ||
| 748 | @findex vc-ediff | 783 | @findex vc-root-diff |
| 749 | The function @code{vc-ediff} works like @code{vc-diff} and provides a way to | 784 | @kindex C-x v D |
| 750 | visually compare two revisions of a file in an Ediff session, @pxref{Top, | 785 | @kbd{C-x v D} (@code{vc-root-diff}) is similar to @kbd{C-x v =}, but |
| 751 | Ediff, ediff, The Ediff Manual}. It compares the file associated with the | 786 | it displays a comparison between the entire current version controlled |
| 752 | current buffer with the last repository revision. To compare two arbitrary | 787 | tree (i.e.@: the tree controlled by the version control system |
| 753 | revisions of the current file, call @code{vc-ediff} with a prefix argument. | 788 | associated with the current VC fileset, which may include files that |
| 789 | are not part of that fileset) and the tree you started with. If you | ||
| 790 | invoke this command from a Dired buffer, it applies to the entire | ||
| 791 | version controlled tree containing the directory. | ||
| 754 | 792 | ||
| 755 | @vindex vc-diff-switches | 793 | @vindex vc-diff-switches |
| 756 | @vindex vc-rcs-diff-switches | 794 | You can customize the @command{diff} options that @kbd{C-x v =} and |
| 757 | @kbd{C-x v =} works by running a variant of the @code{diff} utility | 795 | @kbd{C-x v D} use for generating diffs. The options used are taken |
| 758 | designed to work with the version control system in use. The options | 796 | from the first non-@code{nil} value amongst the variables |
| 759 | to pass to the @code{diff} command are taken from the first non-@code{nil} | 797 | @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, and |
| 760 | value of @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, | 798 | @code{diff-switches} (@pxref{Comparing Files}), in that order. Here, |
| 761 | and @code{diff-switches} (@pxref{Comparing Files}), in that order. | 799 | @var{backend} stands for the current version control system, |
| 762 | Since @code{nil} means to check the next variable in the sequence, | 800 | e.g.@: @code{bzr} for Bazaar. Since @code{nil} means to check the |
| 763 | either of the first two may use the value @code{t} to mean no switches at all. | 801 | next variable in the sequence, either of the first two may use the |
| 764 | Most of the @samp{vc@dots{}diff-switches} variables default to | 802 | value @code{t} to mean no switches at all. Most of the |
| 765 | @code{nil}, but some default to @code{t}. These are for those version | 803 | @code{vc-@var{backend}-diff-switches} variables default to @code{nil}, |
| 766 | control systems (e.g. SVN) whose @code{diff} implementations do not | 804 | but some default to @code{t}; these are for version control systems, |
| 767 | accept common options (e.g. @samp{-c}) likely to be in | 805 | such as Subversion, whose @code{diff} implementations do not accept |
| 768 | @code{diff-switches}. | 806 | common diff options. |
| 769 | 807 | ||
| 770 | The buffer produced by @kbd{C-x v =} supports the commands of | 808 | @findex vc-revision-other-window |
| 771 | Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and | 809 | @kindex C-x v ~ |
| 772 | @kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always | 810 | To directly examine an older version of a file, visit the work file |
| 773 | find the corresponding locations in the current work file. (Older | 811 | and type @kbd{C-x v ~ @var{revision} @key{RET}} |
| 774 | revisions are not, in general, present as files on your disk.) | 812 | (@code{vc-revision-other-window}). This retrieves the file version |
| 813 | corresponding to @var{revision}, saves it to | ||
| 814 | @file{@var{filename}.~@var{revision}~}, and visits it in a separate | ||
| 815 | window. | ||
| 775 | 816 | ||
| 776 | @findex vc-annotate | 817 | @findex vc-annotate |
| 777 | @kindex C-x v g | 818 | @kindex C-x v g |
| 778 | For some back ends, you can display the file @dfn{annotated} with | 819 | Many version control systems allow you to view files @dfn{annotated} |
| 779 | per-line revision information, by typing @kbd{C-x v g} | 820 | with per-line revision information, by typing @kbd{C-x v g} |
| 780 | (@code{vc-annotate}). This creates a new buffer (the ``annotate | 821 | (@code{vc-annotate}). This creates a new buffer (the ``annotate |
| 781 | buffer'') displaying the file's text, with each part colored to show | 822 | buffer'') displaying the file's text, with each line colored to show |
| 782 | how old it is. Text colored red is new, blue means old, and | 823 | how old it is. Red text is new, blue is old, and intermediate colors |
| 783 | intermediate colors indicate intermediate ages. By default, the color | 824 | indicate intermediate ages. By default, the color is scaled over the |
| 784 | is scaled over the full range of ages, such that the oldest changes | 825 | full range of ages, such that the oldest changes are blue, and the |
| 785 | are blue, and the newest changes are red. | 826 | newest changes are red. |
| 786 | 827 | ||
| 787 | When you give a prefix argument to this command, Emacs reads two | 828 | When you give a prefix argument to this command, Emacs reads two |
| 788 | arguments using the minibuffer: the ID of which revision to display and | 829 | arguments using the minibuffer: the revision to display and annotate |
| 789 | annotate (instead of the current file contents), and the time span in | 830 | (instead of the current file contents), and the time span in days the |
| 790 | days the color range should cover. | 831 | color range should cover. |
| 791 | 832 | ||
| 792 | From the annotate buffer, these and other color scaling options are | 833 | From the annotate buffer, these and other color scaling options are |
| 793 | available from the @samp{VC-Annotate} menu. In this buffer, you can | 834 | available from the @samp{VC-Annotate} menu. In this buffer, you can |
| @@ -796,13 +837,13 @@ view diffs, or view log entries: | |||
| 796 | 837 | ||
| 797 | @table @kbd | 838 | @table @kbd |
| 798 | @item p | 839 | @item p |
| 799 | Annotate the previous revision, that is to say, the revision before | 840 | Annotate the previous revision, i.e.@: the revision before the one |
| 800 | the one currently annotated. A numeric prefix argument is a repeat | 841 | currently annotated. A numeric prefix argument is a repeat count, so |
| 801 | count, so @kbd{C-u 10 p} would take you back 10 revisions. | 842 | @kbd{C-u 10 p} would take you back 10 revisions. |
| 802 | 843 | ||
| 803 | @item n | 844 | @item n |
| 804 | Annotate the next revision---the one after the revision currently | 845 | Annotate the next revision, i.e.@: the revision after the one |
| 805 | annotated. A numeric prefix argument is a repeat count. | 846 | currently annotated. A numeric prefix argument is a repeat count. |
| 806 | 847 | ||
| 807 | @item j | 848 | @item j |
| 808 | Annotate the revision indicated by the current line. | 849 | Annotate the revision indicated by the current line. |
| @@ -841,72 +882,8 @@ Toggle the annotation visibility. This is useful for looking just at | |||
| 841 | the file contents without distraction from the annotations. | 882 | the file contents without distraction from the annotations. |
| 842 | @end table | 883 | @end table |
| 843 | 884 | ||
| 844 | @node Secondary VC Commands | ||
| 845 | @subsection The Secondary Commands of VC | ||
| 846 | |||
| 847 | This section explains the secondary commands of VC. | ||
| 848 | |||
| 849 | @menu | ||
| 850 | * Registering:: Putting a file under version control. | ||
| 851 | * VC Change Log:: Viewing the VC Change Log. | ||
| 852 | * VC Undo:: Canceling changes before or after check-in. | ||
| 853 | @end menu | ||
| 854 | |||
| 855 | @node Registering | ||
| 856 | @subsubsection Registering a File for Version Control | ||
| 857 | |||
| 858 | @kindex C-x v i | ||
| 859 | @findex vc-register | ||
| 860 | You can put any file under version control by simply visiting it, and | ||
| 861 | then typing @w{@kbd{C-x v i}} (@code{vc-register}). | ||
| 862 | |||
| 863 | @table @kbd | ||
| 864 | @item C-x v i | ||
| 865 | Register the visited file for version control. | ||
| 866 | @end table | ||
| 867 | |||
| 868 | To register the file, Emacs must choose which version control system | ||
| 869 | to use for it. If the file's directory already contains files | ||
| 870 | registered in a version control system, Emacs uses that system. If | ||
| 871 | there is more than one system in use for a directory, Emacs uses the | ||
| 872 | one that appears first in @code{vc-handled-backends} | ||
| 873 | @iftex | ||
| 874 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 875 | @end iftex | ||
| 876 | @ifnottex | ||
| 877 | (@pxref{Customizing VC}). | ||
| 878 | @end ifnottex | ||
| 879 | On the other hand, if there are no files already registered, Emacs uses | ||
| 880 | the first system from @code{vc-handled-backends} that could register | ||
| 881 | the file (for example, you cannot register a file under CVS if its | ||
| 882 | directory is not already part of a CVS tree); with the default value | ||
| 883 | of @code{vc-handled-backends}, this means that Emacs uses RCS in this | ||
| 884 | situation. | ||
| 885 | |||
| 886 | If locking is in use, @kbd{C-x v i} leaves the file unlocked and | ||
| 887 | read-only. Type @kbd{C-x v v} if you wish to start editing it. After | ||
| 888 | registering a file with CVS, you must subsequently commit the initial | ||
| 889 | revision by typing @kbd{C-x v v}. Until you do that, the revision ID | ||
| 890 | appears as @samp{@@@@} in the mode line. | ||
| 891 | |||
| 892 | @vindex vc-default-init-revision | ||
| 893 | @cindex initial revision ID to register | ||
| 894 | The default initial revision ID for a newly registered file | ||
| 895 | varies by what VCS you are using; normally it will be 1.1 on VCSes | ||
| 896 | that use dot-pair revision IDs and 1 on VCSes that use monotonic IDs. | ||
| 897 | You can specify a different default by setting the variable | ||
| 898 | @code{vc-default-init-revision}, or you can give @kbd{C-x v i} a | ||
| 899 | numeric argument; then it reads the initial revision ID for this | ||
| 900 | particular file using the minibuffer. | ||
| 901 | |||
| 902 | @c See http://debbugs.gnu.org/9745 | ||
| 903 | @c @vindex vc-initial-comment | ||
| 904 | @c If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an | ||
| 905 | @c initial comment to describe the purpose of this source file. Reading | ||
| 906 | @c the initial comment works like reading a log entry (@pxref{Log Buffer}). | ||
| 907 | |||
| 908 | @node VC Change Log | 885 | @node VC Change Log |
| 909 | @subsubsection VC Change Log | 886 | @subsection VC Change Log |
| 910 | 887 | ||
| 911 | @table @kbd | 888 | @table @kbd |
| 912 | @item C-x v l | 889 | @item C-x v l |
| @@ -929,21 +906,31 @@ Display the changes that will be sent by the next push operation | |||
| 929 | @kindex C-x v l | 906 | @kindex C-x v l |
| 930 | @findex vc-print-log | 907 | @findex vc-print-log |
| 931 | The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer | 908 | The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer |
| 932 | named @samp{*vc-change-log*} in a new window. This buffer lists the | 909 | named @samp{*vc-change-log*}, showing the history of changes made to |
| 933 | changes to the current file, including the associated log entries. | 910 | the current file, including who made the changes, the dates, and the |
| 934 | (These are the log entries associated with the version control system, | 911 | log entry for each change (these are the same log entries you would |
| 935 | i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log | 912 | enter via the @samp{*vc-log*} buffer; @pxref{Log Buffer}). Point is |
| 936 | Buffer}.) Point is centered at the revision of the file currently | 913 | centered at the revision of the file currently being visited. With a |
| 937 | being visited. With a prefix argument, the command prompts for the | 914 | prefix argument, the command prompts for the revision to center on, |
| 938 | revision to center on, and the maximum number of revisions to display. | 915 | and the maximum number of revisions to display. |
| 939 | You can call this command from a Dired buffer (@pxref{Dired}). | 916 | |
| 917 | If you call @kbd{C-x v l} from a VC Directory buffer (@pxref{VC | ||
| 918 | Directory Mode}) or a Dired buffer (@pxref{Dired}), it applies to the | ||
| 919 | file listed on the current line. | ||
| 940 | 920 | ||
| 941 | @findex vc-print-root-log | 921 | @findex vc-print-root-log |
| 942 | Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a | 922 | @findex log-view-toggle-entry-display |
| 943 | @samp{*vc-change-log*} buffer showing the history of the | 923 | @kbd{C-x v L} (@code{vc-print-root-log}) displays a |
| 944 | version-controlled directory tree as a whole. With a prefix argument, | 924 | @samp{*vc-change-log*} buffer showing the history of the entire |
| 945 | the command prompts for the maximum number of revisions to display. | 925 | version-controlled directory tree (RCS, SCCS, and CVS do not support |
| 946 | RCS, SCCS, and CVS do not support this feature. | 926 | this feature). With a prefix argument, the command prompts for the |
| 927 | maximum number of revisions to display. | ||
| 928 | |||
| 929 | 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 | ||
| 931 | type @key{RET} (@code{log-view-toggle-entry-display}) in the | ||
| 932 | @samp{*vc-change-log*} buffer to reveal the entire log entry for the | ||
| 933 | revision at point. A second @key{RET} hides it again. | ||
| 947 | 934 | ||
| 948 | On a distributed version control system, the @kbd{C-x v I} | 935 | On a distributed version control system, the @kbd{C-x v I} |
| 949 | (@code{vc-log-incoming}) command displays a log buffer showing the | 936 | (@code{vc-log-incoming}) command displays a log buffer showing the |
| @@ -952,62 +939,58 @@ control system's ``pull'' command to get new revisions from another | |||
| 952 | repository. This other repository is the default one from which | 939 | repository. This other repository is the default one from which |
| 953 | changes are pulled, as defined by the version control system; with a | 940 | changes are pulled, as defined by the version control system; with a |
| 954 | prefix argument, @code{vc-log-incoming} prompts for a specific | 941 | prefix argument, @code{vc-log-incoming} prompts for a specific |
| 955 | repository from which changes would be pulled, and lists the changes | 942 | repository. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows |
| 956 | accordingly. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows | ||
| 957 | the changes that will be sent to another repository, the next time you | 943 | the changes that will be sent to another repository, the next time you |
| 958 | run the ``push'' command; with a prefix argument, it prompts for a | 944 | run the ``push'' command; with a prefix argument, it prompts for a |
| 959 | specific repository to which changes would be pushed. | 945 | specific destination repository. |
| 960 | 946 | ||
| 961 | In the @samp{*vc-change-log*} buffer, you can use the following keys | 947 | In the @samp{*vc-change-log*} buffer, you can use the following keys |
| 962 | to move between the logs of revisions and of files, to view past | 948 | to move between the logs of revisions and of files, and to examine and |
| 963 | revisions, to modify change comments, to view annotations and to view | 949 | compare past revisions (@pxref{Old Revisions}): |
| 964 | diffs: | ||
| 965 | 950 | ||
| 966 | @table @kbd | 951 | @table @kbd |
| 967 | @item p | 952 | @item p |
| 968 | Move to the previous revision-item in the buffer. (Revision entries in the log | 953 | Move to the previous revision entry. (Revision entries in the log |
| 969 | buffer are usually in reverse-chronological order, so the previous | 954 | buffer are usually in reverse-chronological order, so the previous |
| 970 | revision-item usually corresponds to a newer revision.) A numeric | 955 | revision-item usually corresponds to a newer revision.) A numeric |
| 971 | prefix argument is a repeat count. | 956 | prefix argument is a repeat count. |
| 972 | 957 | ||
| 973 | @item n | 958 | @item n |
| 974 | Move to the next revision-item (which most often corresponds to the | 959 | Move to the next revision entry. A numeric prefix argument is a |
| 975 | previous revision of the file). A numeric prefix argument is a repeat | 960 | repeat count. |
| 976 | count. | ||
| 977 | 961 | ||
| 978 | @item P | 962 | @item P |
| 979 | Move to the log of the previous file, when the logs of multiple files | 963 | Move to the log of the previous file, if showing logs for a multi-file |
| 980 | are in the log buffer (@pxref{VC Directory Mode}). Otherwise, just | 964 | VC fileset. Otherwise, just move to the beginning of the log. A |
| 981 | move to the beginning of the log. A numeric prefix argument is a | 965 | numeric prefix argument is a repeat count. |
| 982 | repeat count, so @kbd{C-u 10 P} would move backward 10 files. | ||
| 983 | 966 | ||
| 984 | @item N | 967 | @item N |
| 985 | Move to the log of the next file, when the logs of multiple files are | 968 | Move to the log of the next file, if showing logs for a multi-file VC |
| 986 | in the log buffer (@pxref{VC Directory Mode}). It also takes a | 969 | fileset. A numeric prefix argument is a repeat count. |
| 987 | numeric prefix argument as a repeat count. | ||
| 988 | 970 | ||
| 989 | @item a | 971 | @item a |
| 990 | Annotate the revision indicated by the current line. | 972 | Annotate the revision on the current line (@pxref{Old Revisions}). |
| 991 | 973 | ||
| 992 | @item e | 974 | @item e |
| 993 | Modify the change comment displayed at point. Note that not all VC | 975 | Modify the change comment displayed at point. Note that not all VC |
| 994 | systems support modifying change comments. | 976 | systems support modifying change comments. |
| 995 | 977 | ||
| 996 | @item f | 978 | @item f |
| 997 | Visit the revision indicated at the current line, like typing @kbd{C-x | 979 | Visit the revision indicated at the current line. |
| 998 | v ~} and specifying this revision's ID (@pxref{Old Revisions}). | ||
| 999 | 980 | ||
| 1000 | @item d | 981 | @item d |
| 1001 | Display the diff (@pxref{Comparing Files}) between the revision | 982 | Display a diff between the revision at point and the next earlier |
| 1002 | indicated at the current line and the next earlier revision. This is | 983 | revision, for the specific file. |
| 1003 | useful to see what actually changed in the file when the revision | ||
| 1004 | indicated on the current line was committed. | ||
| 1005 | 984 | ||
| 1006 | @item D | 985 | @item D |
| 1007 | Display the changeset diff (@pxref{Comparing Files}) between the | 986 | Display the changeset diff between the revision at point and the next |
| 1008 | revision indicated at the current line and the next earlier revision. | 987 | earlier revision. This shows the changes to all files made in that |
| 1009 | This is useful to see all the changes to all files that the revision | 988 | revision. |
| 1010 | indicated on the current line did when it was committed. | 989 | |
| 990 | @item @key{RET} | ||
| 991 | In a compact-style log buffer (e.g.@: the one created by @kbd{C-x v | ||
| 992 | L}), toggle between showing and hiding the full log entry for the | ||
| 993 | revision at point. | ||
| 1011 | @end table | 994 | @end table |
| 1012 | 995 | ||
| 1013 | @vindex vc-log-show-limit | 996 | @vindex vc-log-show-limit |
| @@ -1021,7 +1004,7 @@ entries} or @samp{Show unlimited entries} buttons at the end of the | |||
| 1021 | buffer. However, RCS, SCCS, and CVS do not support this feature. | 1004 | buffer. However, RCS, SCCS, and CVS do not support this feature. |
| 1022 | 1005 | ||
| 1023 | @node VC Undo | 1006 | @node VC Undo |
| 1024 | @subsubsection Undoing Version Control Actions | 1007 | @subsection Undoing Version Control Actions |
| 1025 | 1008 | ||
| 1026 | @table @kbd | 1009 | @table @kbd |
| 1027 | @item C-x v u | 1010 | @item C-x v u |
| @@ -1030,7 +1013,7 @@ editing the file. | |||
| 1030 | 1013 | ||
| 1031 | @item C-x v c | 1014 | @item C-x v c |
| 1032 | Remove the last-entered change from the master for the visited file. | 1015 | Remove the last-entered change from the master for the visited file. |
| 1033 | This undoes your last check-in. | 1016 | This undoes your last commit. |
| 1034 | @end table | 1017 | @end table |
| 1035 | 1018 | ||
| 1036 | @kindex C-x v u | 1019 | @kindex C-x v u |
| @@ -1133,7 +1116,7 @@ This is because access to the repository may be slow, or you may be | |||
| 1133 | working offline and not have access to the repository at all. As a | 1116 | working offline and not have access to the repository at all. As a |
| 1134 | consequence, VC would not be able to tell you that @samp{file3.c} is | 1117 | consequence, VC would not be able to tell you that @samp{file3.c} is |
| 1135 | in the ``merge'' state; you would learn that only when you try to | 1118 | in the ``merge'' state; you would learn that only when you try to |
| 1136 | check-in your modified copy of the file, or use a command such as | 1119 | commit your modified copy of the file, or use a command such as |
| 1137 | @kbd{C-x v m}. | 1120 | @kbd{C-x v m}. |
| 1138 | 1121 | ||
| 1139 | In practice, this is not a problem because CVS handles this case | 1122 | In practice, this is not a problem because CVS handles this case |
| @@ -1330,7 +1313,7 @@ because that's the only way to add a new revision at a point that is | |||
| 1330 | not the head of a branch. | 1313 | not the head of a branch. |
| 1331 | 1314 | ||
| 1332 | After the branch is created, you ``stay'' on it. That means that | 1315 | After the branch is created, you ``stay'' on it. That means that |
| 1333 | subsequent check-ins create new revisions on that branch. To leave the | 1316 | subsequent commits create new revisions on that branch. To leave the |
| 1334 | branch, you must explicitly select a different revision with @kbd{C-u C-x | 1317 | branch, you must explicitly select a different revision with @kbd{C-u C-x |
| 1335 | v v}. To transfer changes from one branch to another, use the merge | 1318 | v v}. To transfer changes from one branch to another, use the merge |
| 1336 | command, described in the next section. | 1319 | command, described in the next section. |
| @@ -1379,7 +1362,7 @@ of the work file. You can now commit the changed file, thus creating | |||
| 1379 | revision 1.6 containing the changes from the branch. | 1362 | revision 1.6 containing the changes from the branch. |
| 1380 | 1363 | ||
| 1381 | It is possible to do further editing after merging the branch, before | 1364 | It is possible to do further editing after merging the branch, before |
| 1382 | the next check-in. But it is usually wiser to commit the merged | 1365 | the next commit. But it is usually wiser to commit the merged |
| 1383 | revision, then lock it and make the further changes. This will keep | 1366 | revision, then lock it and make the further changes. This will keep |
| 1384 | a better record of the history of changes. | 1367 | a better record of the history of changes. |
| 1385 | 1368 | ||
| @@ -852,6 +852,7 @@ the user for specifics, e.g. a merge source. | |||
| 852 | *** New option `vc-revert-show-diff' controls whether `vc-revert' | 852 | *** New option `vc-revert-show-diff' controls whether `vc-revert' |
| 853 | shows a diff while querying the user. It defaults to t. | 853 | shows a diff while querying the user. It defaults to t. |
| 854 | 854 | ||
| 855 | +++ | ||
| 855 | *** Log entries in some Log View buffers can be toggled to display a | 856 | *** Log entries in some Log View buffers can be toggled to display a |
| 856 | longer description by typing RET (log-view-toggle-entry-display). | 857 | longer description by typing RET (log-view-toggle-entry-display). |
| 857 | In the Log View buffers made by `C-x v L' (vc-print-root-log), you can | 858 | In the Log View buffers made by `C-x v L' (vc-print-root-log), you can |
| @@ -862,6 +863,7 @@ use this to display the full log entry for the revision at point. | |||
| 862 | **** Packages using Log View mode can enable this functionality by | 863 | **** Packages using Log View mode can enable this functionality by |
| 863 | binding `log-view-expanded-log-entry-function' to a suitable function. | 864 | binding `log-view-expanded-log-entry-function' to a suitable function. |
| 864 | 865 | ||
| 866 | +++ | ||
| 865 | *** New command `vc-ediff' allows visual comparison of two revisions | 867 | *** New command `vc-ediff' allows visual comparison of two revisions |
| 866 | of a file similar to `vc-diff', but using ediff backend. | 868 | of a file similar to `vc-diff', but using ediff backend. |
| 867 | 869 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb7be329d84..990a7259bc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | 2011-12-16 Chong Yidong <cyd@gnu.org> | 1 | 2011-12-17 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * vc/vc.el (vc-next-action): Doc fix; remove CVS-isms. | 3 | * vc/vc.el (vc-next-action): Doc fix; remove CVS-isms. |
| 4 | (vc-deduce-fileset): Doc fix. | ||
| 4 | 5 | ||
| 5 | 2011-12-16 Andreas Schwab <schwab@linux-m68k.org> | 6 | 2011-12-16 Andreas Schwab <schwab@linux-m68k.org> |
| 6 | 7 | ||
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 85fbd93e9c6..87e8901e33a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -951,13 +951,13 @@ Within directories, only files already under version control are noticed." | |||
| 951 | (defun vc-deduce-fileset (&optional observer allow-unregistered | 951 | (defun vc-deduce-fileset (&optional observer allow-unregistered |
| 952 | state-model-only-files) | 952 | state-model-only-files) |
| 953 | "Deduce a set of files and a backend to which to apply an operation. | 953 | "Deduce a set of files and a backend to which to apply an operation. |
| 954 | |||
| 955 | Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). | 954 | Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). |
| 956 | If we're in VC-dir mode, the fileset is the list of marked files. | 955 | |
| 957 | Otherwise, if we're looking at a buffer visiting a version-controlled file, | 956 | If we're in VC-dir mode, FILESET is the list of marked files. |
| 958 | the fileset is a singleton containing this file. | 957 | Otherwise, if in a buffer visiting a version-controlled file, |
| 959 | If none of these conditions is met, but ALLOW_UNREGISTERED is on and the | 958 | FILESET is a single-file fileset containing that file. |
| 960 | visited file is not registered, return a singleton fileset containing it. | 959 | Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file |
| 960 | is unregistered, FILESET is a single-file fileset containing it. | ||
| 961 | Otherwise, throw an error. | 961 | Otherwise, throw an error. |
| 962 | 962 | ||
| 963 | STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs | 963 | STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs |