diff options
| author | Chong Yidong | 2011-12-21 16:39:32 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-12-21 16:39:32 +0800 |
| commit | d3098e1ec618fc043568be481b487f3bf7689bad (patch) | |
| tree | f0d880130465a5702c99019158a54daf921ab830 | |
| parent | 204ee57fa0bb286ba4c6f540cefb44ed011a921f (diff) | |
| download | emacs-d3098e1ec618fc043568be481b487f3bf7689bad.tar.gz emacs-d3098e1ec618fc043568be481b487f3bf7689bad.zip | |
More updates for VC documentation.
* files.texi (Misc File Ops): Mention vc-rename-file.
* maintaining.texi (Advanced C-x v v): Use fileset terminology.
(VC With A Merging VCS, VC Change Log): Add xref to VC Pull node.
(VC Pull): Mention vc-log-incoming.
(Log Buffer): Add CVS/RCS only disclaimer.
* vc1-xtra.texi (Remote Repositories): Update introduction.
(Local Version Control): Node deleted (obsolete with DVCSes).
(Remote Repositories, Version Backups): Node deleted. Move
documentation of vc-cvs-stay-local to CVS Options.
(CVS Options): Reduce verbosity of description of obscure CVS
locking feature.
(Making Revision Tags, Revision Tag Caveats): Merge into Revision
Tags node.
(Revision Tags): Move under Miscellaneous VC subsection.
(Change Logs and VC): Note that this is wrong for DVCSs.
De-document log entry manipulating features.
(Renaming and VC): Describe how it works on modern VCSes.
* programs.texi (Custom C Indent): Add index entries.
| -rw-r--r-- | doc/emacs/ChangeLog | 24 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 12 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 8 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 76 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 11 | ||||
| -rw-r--r-- | doc/emacs/vc1-xtra.texi | 627 |
6 files changed, 250 insertions, 508 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 22f9a4ae7cc..8e2b278f84b 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2011-12-21 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * maintaining.texi (Advanced C-x v v): Use fileset terminology. | ||
| 4 | (VC With A Merging VCS, VC Change Log): Add xref to VC Pull node. | ||
| 5 | (VC Pull): Mention vc-log-incoming. | ||
| 6 | (Log Buffer): Add CVS/RCS only disclaimer. | ||
| 7 | |||
| 8 | * vc1-xtra.texi (Remote Repositories): Update introduction. | ||
| 9 | (Local Version Control): Node deleted (obsolete with DVCSes). | ||
| 10 | (Remote Repositories, Version Backups): Node deleted. Move | ||
| 11 | documentation of vc-cvs-stay-local to CVS Options. | ||
| 12 | (CVS Options): Reduce verbosity of description of obscure CVS | ||
| 13 | locking feature. | ||
| 14 | (Making Revision Tags, Revision Tag Caveats): Merge into Revision | ||
| 15 | Tags node. | ||
| 16 | (Revision Tags): Move under Miscellaneous VC subsection. | ||
| 17 | (Change Logs and VC): Note that this is wrong for DVCSs. | ||
| 18 | De-document log entry manipulating features. | ||
| 19 | (Renaming and VC): Describe how it works on modern VCSes. | ||
| 20 | |||
| 21 | * files.texi (Misc File Ops): Mention vc-rename-file. | ||
| 22 | |||
| 23 | * programs.texi (Custom C Indent): Add index entries. | ||
| 24 | |||
| 1 | 2011-12-20 Alan Mackenzie <acm@muc.de> | 25 | 2011-12-20 Alan Mackenzie <acm@muc.de> |
| 2 | 26 | ||
| 3 | * programs.texi (Motion in C): Update the description of C-M-a and | 27 | * programs.texi (Motion in C): Update the description of C-M-a and |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index d3caf4e63df..b12cdf6ddd1 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -747,7 +747,6 @@ Version Control | |||
| 747 | * VC Undo:: Canceling changes before or after committing. | 747 | * VC Undo:: Canceling changes before or after committing. |
| 748 | * VC Directory Mode:: Listing files managed by version control. | 748 | * VC Directory Mode:: Listing files managed by version control. |
| 749 | * Branches:: Multiple lines of development. | 749 | * Branches:: Multiple lines of development. |
| 750 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 751 | * Revision Tags:: Symbolic names for revisions. | 750 | * Revision Tags:: Symbolic names for revisions. |
| 752 | * Miscellaneous VC:: Various other commands and features of VC. | 751 | * Miscellaneous VC:: Various other commands and features of VC. |
| 753 | * Customizing VC:: Variables that change VC's behavior. | 752 | * Customizing VC:: Variables that change VC's behavior. |
| @@ -780,21 +779,12 @@ Multiple Branches of a File | |||
| 780 | * Merging:: Transferring changes between branches. | 779 | * Merging:: Transferring changes between branches. |
| 781 | * Creating Branches:: How to start a new branch. | 780 | * Creating Branches:: How to start a new branch. |
| 782 | 781 | ||
| 783 | Remote Repositories | ||
| 784 | |||
| 785 | * Version Backups:: Keeping local copies of repository versions. | ||
| 786 | * Local Version Control:: Using another version system for local editing. | ||
| 787 | |||
| 788 | Revision Tags | ||
| 789 | |||
| 790 | * Making Revision Tags:: The tag facilities. | ||
| 791 | * Revision Tag Caveats:: Things to be careful of when using tags. | ||
| 792 | |||
| 793 | Miscellaneous Commands and Features of VC | 782 | Miscellaneous Commands and Features of VC |
| 794 | 783 | ||
| 795 | * Change Logs and VC:: Generating a change log file from log entries. | 784 | * Change Logs and VC:: Generating a change log file from log entries. |
| 796 | * Renaming and VC:: A command to rename both the source and master | 785 | * Renaming and VC:: A command to rename both the source and master |
| 797 | file correctly. | 786 | file correctly. |
| 787 | * Revision Tags:: Symbolic names for revisions. | ||
| 798 | * Version Headers:: Inserting version control headers into working files. | 788 | * Version Headers:: Inserting version control headers into working files. |
| 799 | 789 | ||
| 800 | Customizing VC | 790 | Customizing VC |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index e3da0ca44e6..96c38f4190e 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1498,6 +1498,7 @@ it creates a copy of the @var{old} directory and puts it in @var{new}. | |||
| 1498 | If @var{new} is not an existing directory, it copies all the contents | 1498 | If @var{new} is not an existing directory, it copies all the contents |
| 1499 | of @var{old} into a new directory named @var{new}. | 1499 | of @var{old} into a new directory named @var{new}. |
| 1500 | 1500 | ||
| 1501 | @cindex renaming files | ||
| 1501 | @findex rename-file | 1502 | @findex rename-file |
| 1502 | @kbd{M-x rename-file} reads two file names @var{old} and @var{new} | 1503 | @kbd{M-x rename-file} reads two file names @var{old} and @var{new} |
| 1503 | using the minibuffer, then renames file @var{old} as @var{new}. If | 1504 | using the minibuffer, then renames file @var{old} as @var{new}. If |
| @@ -1512,6 +1513,13 @@ RET /tmp RET} renames @file{~/foo} to @file{/tmp/foo}. The same rule | |||
| 1512 | applies to all the remaining commands in this section. All of them | 1513 | applies to all the remaining commands in this section. All of them |
| 1513 | ask for confirmation when the new file name already exists, too. | 1514 | ask for confirmation when the new file name already exists, too. |
| 1514 | 1515 | ||
| 1516 | @ifnottex | ||
| 1517 | Note that if a file is under version control (@pxref{Version | ||
| 1518 | Control}), you normally ought to rename it via the version control | ||
| 1519 | system instead, using @kbd{M-x vc-rename-file}. @xref{Renaming and | ||
| 1520 | VC}. | ||
| 1521 | @end ifnottex | ||
| 1522 | |||
| 1515 | @findex add-name-to-file | 1523 | @findex add-name-to-file |
| 1516 | @cindex hard links (creation) | 1524 | @cindex hard links (creation) |
| 1517 | @kbd{M-x add-name-to-file} adds an additional name to an existing | 1525 | @kbd{M-x add-name-to-file} adds an additional name to an existing |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8bf7d74f9b6..488bdf87320 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -56,8 +56,6 @@ variable @code{vc-handled-backends} to @code{nil} | |||
| 56 | * VC Directory Mode:: Listing files managed by version control. | 56 | * VC Directory Mode:: Listing files managed by version control. |
| 57 | * Branches:: Multiple lines of development. | 57 | * Branches:: Multiple lines of development. |
| 58 | @ifnottex | 58 | @ifnottex |
| 59 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 60 | * Revision Tags:: Symbolic names for revisions. | ||
| 61 | * Miscellaneous VC:: Various other commands and features of VC. | 59 | * Miscellaneous VC:: Various other commands and features of VC. |
| 62 | * Customizing VC:: Variables that change VC's behavior. | 60 | * Customizing VC:: Variables that change VC's behavior. |
| 63 | @end ifnottex | 61 | @end ifnottex |
| @@ -482,10 +480,11 @@ commit. @xref{Log Buffer}. | |||
| 482 | 480 | ||
| 483 | If committing to a shared repository, the commit may fail if the | 481 | If committing to a shared repository, the commit may fail if the |
| 484 | repository that has been changed since your last update. In that | 482 | repository that has been changed since your last update. In that |
| 485 | case, you must perform an update before trying again. If using a | 483 | case, you must perform an update before trying again. On a |
| 486 | decentralized version control system, use @kbd{C-x v +} or @kbd{C-x v | 484 | decentralized version control system, use @kbd{C-x v +} (@pxref{VC |
| 487 | m} (@pxref{Merging}). If using a centralized version control system, | 485 | Pull}) or @kbd{C-x v m} (@pxref{Merging}). On a centralized version |
| 488 | type @kbd{C-x v v} again to merge in the repository changes. | 486 | control system, type @kbd{C-x v v} again to merge in the repository |
| 487 | changes. | ||
| 489 | 488 | ||
| 490 | @item | 489 | @item |
| 491 | Finally, if you are using a centralized version control system, check | 490 | Finally, if you are using a centralized version control system, check |
| @@ -557,31 +556,27 @@ to do the operation. | |||
| 557 | 556 | ||
| 558 | @itemize @bullet | 557 | @itemize @bullet |
| 559 | @item | 558 | @item |
| 560 | If the file is modified (or locked), you can specify the revision ID | 559 | @cindex specific version control system |
| 561 | to use for the new version that you commit. This is one way to create | 560 | You can specify the name of a version control system. This is useful |
| 562 | a new branch (@pxref{Branches}). | 561 | if the fileset can be managed by more than one version control system, |
| 562 | and Emacs fails to detect the correct one. | ||
| 563 | 563 | ||
| 564 | @item | 564 | @item |
| 565 | If the file is not modified (and unlocked), you can specify the | 565 | Otherwise, if using CVS or RCS, you can specify a revision ID. |
| 566 | revision to select; this lets you start working from an older | ||
| 567 | revision, or on another branch. If you do not enter any revision, | ||
| 568 | that takes you to the highest (``head'') revision on the current | ||
| 569 | branch; therefore @kbd{C-u C-x v v @key{RET}} is a convenient way to | ||
| 570 | get the latest version of a file from the repository. | ||
| 571 | 566 | ||
| 572 | @item | 567 | If the fileset is modified (or locked), this makes Emacs commit with |
| 573 | @cindex specific version control system | 568 | that revision ID. You can create a new branch by supplying an |
| 574 | Instead of the revision ID, you can also specify the name of a | 569 | appropriate revision ID (@pxref{Branches}). |
| 575 | version control system. This is useful when one file is being managed | ||
| 576 | with two version control systems at the same time | ||
| 577 | @iftex | ||
| 578 | (@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs | ||
| 579 | Features}). | ||
| 580 | @end iftex | ||
| 581 | @ifnottex | ||
| 582 | (@pxref{Local Version Control}). | ||
| 583 | @end ifnottex | ||
| 584 | 570 | ||
| 571 | If the fileset is unmodified (and unlocked), this checks the specified | ||
| 572 | revision into the working tree. You can also specify a revision on | ||
| 573 | another branch by giving its revision or branch ID (@pxref{Switching | ||
| 574 | Branches}). An empty argument (i.e.@: @kbd{C-u C-x v v @key{RET}}) | ||
| 575 | checks out the latest (``head'') revision on the current branch. | ||
| 576 | |||
| 577 | This signals an error on a decentralized version control system. | ||
| 578 | Those systems do not let you specify your own revision IDs, nor do | ||
| 579 | they use the concept of ``checking out'' individual files. | ||
| 585 | @end itemize | 580 | @end itemize |
| 586 | 581 | ||
| 587 | @node Log Buffer | 582 | @node Log Buffer |
| @@ -646,8 +641,9 @@ the @samp{*vc-log*} buffer. If the topmost item in each | |||
| 646 | this command searches that item for entries matching the file(s) to be | 641 | this command searches that item for entries matching the file(s) to be |
| 647 | committed, and inserts them. | 642 | committed, and inserts them. |
| 648 | @ifnottex | 643 | @ifnottex |
| 649 | @xref{Change Logs and VC}, for the opposite way of | 644 | If you are using CVS or RCS, see @ref{Change Logs and VC}, for the |
| 650 | working---generating ChangeLog entries from the Log Edit buffer. | 645 | opposite way of working---generating ChangeLog entries from the Log |
| 646 | Edit buffer. | ||
| 651 | @end ifnottex | 647 | @end ifnottex |
| 652 | 648 | ||
| 653 | To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that | 649 | To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that |
| @@ -935,13 +931,13 @@ revision at point. A second @key{RET} hides it again. | |||
| 935 | (@code{vc-log-incoming}) command displays a log buffer showing the | 931 | (@code{vc-log-incoming}) command displays a log buffer showing the |
| 936 | changes that will be applied, the next time you run the version | 932 | changes that will be applied, the next time you run the version |
| 937 | control system's ``pull'' command to get new revisions from another | 933 | control system's ``pull'' command to get new revisions from another |
| 938 | repository. This other repository is the default one from which | 934 | repository (@pxref{VC Pull}). This other repository is the default |
| 939 | changes are pulled, as defined by the version control system; with a | 935 | one from which changes are pulled, as defined by the version control |
| 940 | prefix argument, @code{vc-log-incoming} prompts for a specific | 936 | system; with a prefix argument, @code{vc-log-incoming} prompts for a |
| 941 | repository. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows | 937 | specific repository. Similarly, @kbd{C-x v O} |
| 942 | the changes that will be sent to another repository, the next time you | 938 | (@code{vc-log-outgoing}) shows the changes that will be sent to |
| 943 | run the ``push'' command; with a prefix argument, it prompts for a | 939 | another repository, the next time you run the ``push'' command; with a |
| 944 | specific destination repository. | 940 | prefix argument, it prompts for a specific destination repository. |
| 945 | 941 | ||
| 946 | In the @samp{*vc-change-log*} buffer, you can use the following keys | 942 | In the @samp{*vc-change-log*} buffer, you can use the following keys |
| 947 | to move between the logs of revisions and of files, and to examine and | 943 | to move between the logs of revisions and of files, and to examine and |
| @@ -1339,8 +1335,8 @@ command to use, which lets you specify where to pull changes from. | |||
| 1339 | Otherwise, it pulls from a default location determined by the version | 1335 | Otherwise, it pulls from a default location determined by the version |
| 1340 | control system. | 1336 | control system. |
| 1341 | 1337 | ||
| 1342 | Amongst decentralized version control systems, @kbd{C-x v +} | 1338 | Amongst decentralized version control systems, @kbd{C-x v +} is |
| 1343 | currently supports only Bazaar, Git, and Mercurial. On Bazaar, it | 1339 | currently supported only by Bazaar, Git, and Mercurial. On Bazaar, it |
| 1344 | calls @command{bzr pull} for ordinary branches (to pull from a master | 1340 | calls @command{bzr pull} for ordinary branches (to pull from a master |
| 1345 | branch into a mirroring branch), and @command{bzr update} for a bound | 1341 | branch into a mirroring branch), and @command{bzr update} for a bound |
| 1346 | branch (to pull from a central repository). On Git, it calls | 1342 | branch (to pull from a central repository). On Git, it calls |
| @@ -1349,6 +1345,10 @@ it into the current branch. On Mercurial, it calls @command{hg pull | |||
| 1349 | -u} to fetch changesets from the default remote repository and update | 1345 | -u} to fetch changesets from the default remote repository and update |
| 1350 | the working directory. | 1346 | the working directory. |
| 1351 | 1347 | ||
| 1348 | Prior to pulling, you can use @kbd{C-x v I} (@code{vc-log-incoming}) | ||
| 1349 | to view a log buffer of the changes to be applied. @xref{VC Change | ||
| 1350 | Log}. | ||
| 1351 | |||
| 1352 | On a centralized version control system like CVS, @kbd{C-x v +} | 1352 | On a centralized version control system like CVS, @kbd{C-x v +} |
| 1353 | updates the current VC fileset from the repository. | 1353 | updates the current VC fileset from the repository. |
| 1354 | 1354 | ||
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 892c574734b..e2051a93c60 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -606,12 +606,13 @@ information on customizing indentation for C and related modes, | |||
| 606 | including how to override parts of an existing style and how to define | 606 | including how to override parts of an existing style and how to define |
| 607 | your own styles. | 607 | your own styles. |
| 608 | 608 | ||
| 609 | As an alternative to specifying a style, you can get Emacs to | 609 | @findex c-guess |
| 610 | @dfn{guess} the style by scanning a code buffer which is already | 610 | @findex c-guess-install |
| 611 | formatted. To do this, call @kbd{M-x c-guess} in your sample buffer. | 611 | As an alternative to specifying a style, you can tell Emacs to guess |
| 612 | You can then apply this guessed style to other buffers with @kbd{M-x | 612 | a style by typing @kbd{M-x c-guess} in a sample code buffer. You can |
| 613 | then apply the guessed style to other buffers with @kbd{M-x | ||
| 613 | c-guess-install}. @xref{Guessing the Style,,, ccmode, the CC Mode | 614 | c-guess-install}. @xref{Guessing the Style,,, ccmode, the CC Mode |
| 614 | Manual}, for more details about this mechanism. | 615 | Manual}, for details. |
| 615 | 616 | ||
| 616 | @node Parentheses | 617 | @node Parentheses |
| 617 | @section Commands for Editing with Parentheses | 618 | @section Commands for Editing with Parentheses |
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index c4a4b351cac..700003db58a 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi | |||
| @@ -5,301 +5,6 @@ | |||
| 5 | @c This file is included either in vc-xtra.texi (when producing the | 5 | @c This file is included either in vc-xtra.texi (when producing the |
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | 6 | @c printed version) or in the main Emacs manual (for the on-line version). |
| 7 | 7 | ||
| 8 | @node Remote Repositories | ||
| 9 | @subsection Remote Repositories | ||
| 10 | @cindex remote repositories | ||
| 11 | |||
| 12 | A common way of using CVS and other more advanced VCSes is to set up | ||
| 13 | a central repository on some Internet host, then have each | ||
| 14 | developer check out a personal working copy of the files on his local | ||
| 15 | machine. Committing changes to the repository, and picking up changes | ||
| 16 | from other users into one's own working area, then works by direct | ||
| 17 | interactions with the repository server. | ||
| 18 | |||
| 19 | One difficulty is that access to a repository server is often slow, | ||
| 20 | and that developers might need to work off-line as well. While only | ||
| 21 | third-generation decentralized VCses such as GNU Arch or Mercurial | ||
| 22 | really solve this problem, VC is designed to reduce the amount of | ||
| 23 | network interaction necessary. | ||
| 24 | |||
| 25 | If you are using a truly decentralized VCS you can skip the rest of | ||
| 26 | this section. It describes backup and local-repository techniques | ||
| 27 | that are only useful for Subversion and earlier VCSes. | ||
| 28 | |||
| 29 | @menu | ||
| 30 | * Version Backups:: Keeping local copies of repository versions. | ||
| 31 | * Local Version Control:: Using another version system for local editing. | ||
| 32 | @end menu | ||
| 33 | |||
| 34 | @node Version Backups | ||
| 35 | @subsubsection Version Backups | ||
| 36 | @cindex version backups | ||
| 37 | |||
| 38 | @cindex automatic version backups | ||
| 39 | When VC sees that the repository for a file is on a remote | ||
| 40 | machine, it automatically makes local backups of unmodified versions | ||
| 41 | of the file---@dfn{automatic version backups}. This means that you | ||
| 42 | can compare the file to the repository version (@kbd{C-x v =}), or | ||
| 43 | revert to that version (@kbd{C-x v u}), without any network | ||
| 44 | interactions. | ||
| 45 | |||
| 46 | The local copy of the unmodified file is called a @dfn{version | ||
| 47 | backup} to indicate that it corresponds exactly to a version that is | ||
| 48 | stored in the repository. Note that version backups are not the same | ||
| 49 | as ordinary Emacs backup files | ||
| 50 | @iftex | ||
| 51 | (@pxref{Backup,,,emacs, the Emacs Manual}). | ||
| 52 | @end iftex | ||
| 53 | @ifnottex | ||
| 54 | (@pxref{Backup}). | ||
| 55 | @end ifnottex | ||
| 56 | But they follow a similar naming convention. | ||
| 57 | |||
| 58 | For a file that comes from a remote repository, VC makes a | ||
| 59 | version backup whenever you save the first changes to the file, and | ||
| 60 | removes it after you have committed your modified version to the | ||
| 61 | repository. You can disable the making of automatic version backups by | ||
| 62 | setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | ||
| 63 | |||
| 64 | @cindex manual version backups | ||
| 65 | The name of the automatic version backup for version @var{version} | ||
| 66 | of file @var{file} is @code{@var{file}.~@var{version}.~}. This is | ||
| 67 | almost the same as the name used by @kbd{C-x v ~} | ||
| 68 | @iftex | ||
| 69 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}), | ||
| 70 | @end iftex | ||
| 71 | @ifnottex | ||
| 72 | (@pxref{Old Revisions}), | ||
| 73 | @end ifnottex | ||
| 74 | the only difference being the additional dot (@samp{.}) after the | ||
| 75 | version number. This similarity is intentional, because both kinds of | ||
| 76 | files store the same kind of information. The file made by @kbd{C-x v | ||
| 77 | ~} acts as a @dfn{manual version backup}. | ||
| 78 | |||
| 79 | All the VC commands that operate on old versions of a file can use | ||
| 80 | both kinds of version backups. For instance, @kbd{C-x v ~} uses | ||
| 81 | either an automatic or a manual version backup, if possible, to get | ||
| 82 | the contents of the version you request. Likewise, @kbd{C-x v =} and | ||
| 83 | @kbd{C-x v u} use either an automatic or a manual version backup, if | ||
| 84 | one of them exists, to get the contents of a version to compare or | ||
| 85 | revert to. If you changed a file outside of Emacs, so that no | ||
| 86 | automatic version backup was created for the previous text, you can | ||
| 87 | create a manual backup of that version using @kbd{C-x v ~}, and thus | ||
| 88 | obtain the benefit of the local copy for Emacs commands. | ||
| 89 | |||
| 90 | The only difference in Emacs's handling of manual and automatic | ||
| 91 | version backups, once they exist, is that Emacs deletes automatic | ||
| 92 | version backups when you commit to the repository. By contrast, | ||
| 93 | manual version backups remain until you delete them. | ||
| 94 | |||
| 95 | @node Local Version Control | ||
| 96 | @subsubsection Local Version Control | ||
| 97 | @cindex local version control | ||
| 98 | @cindex local back end (version control) | ||
| 99 | |||
| 100 | When you make many changes to a file that comes from a remote | ||
| 101 | repository, it can be convenient to have version control on your local | ||
| 102 | machine as well. You can then record intermediate versions, revert to | ||
| 103 | a previous state, etc., before you actually commit your changes to the | ||
| 104 | remote server. | ||
| 105 | |||
| 106 | VC lets you do this by putting a file under a second, local version | ||
| 107 | control system, so that the file is effectively registered in two | ||
| 108 | systems at the same time. For the description here, we will assume | ||
| 109 | that the remote system is CVS, and you use RCS locally, although the | ||
| 110 | mechanism works with any combination of version control systems | ||
| 111 | (@dfn{back ends}). | ||
| 112 | |||
| 113 | To make it work with other back ends, you must make sure that the | ||
| 114 | ``more local'' back end comes before the ``more remote'' back end in | ||
| 115 | the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By | ||
| 116 | default, this variable is set up so that you can use remote CVS and | ||
| 117 | local RCS as described here. | ||
| 118 | |||
| 119 | To start using local RCS for a file that comes from a remote CVS | ||
| 120 | server, you must @emph{register the file in RCS}, by typing @kbd{C-u | ||
| 121 | C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a | ||
| 122 | prefix argument, and specify RCS as the back end.) | ||
| 123 | |||
| 124 | You can do this at any time; it does not matter whether you have | ||
| 125 | already modified the file with respect to the version in the CVS | ||
| 126 | repository. If possible, VC tries to make the RCS master start with | ||
| 127 | the unmodified repository version, then checks in any local changes | ||
| 128 | as a new version. This works if you have not made any changes yet, or | ||
| 129 | if the unmodified repository version exists locally as a version | ||
| 130 | backup (@pxref{Version Backups}). If the unmodified version is not | ||
| 131 | available locally, the RCS master starts with the modified version; | ||
| 132 | the only drawback to this is that you cannot compare your changes | ||
| 133 | locally to what is stored in the repository. | ||
| 134 | |||
| 135 | The version number of the RCS master is derived from the current CVS | ||
| 136 | version, starting a branch from it. For example, if the current CVS | ||
| 137 | version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | ||
| 138 | the RCS master will be identical to version 1.23 under CVS; your first | ||
| 139 | changes are checked in as 1.23.1.1. (If the unmodified file is not | ||
| 140 | available locally, VC will check in the modified file twice, both as | ||
| 141 | 1.23 and 1.23.1.1, to make the revision numbers consistent.) | ||
| 142 | |||
| 143 | If you do not use locking under CVS (the default), locking is also | ||
| 144 | disabled for RCS, so that editing under RCS works exactly as under | ||
| 145 | CVS. | ||
| 146 | |||
| 147 | When you are done with local editing, you can commit the final version | ||
| 148 | back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 149 | This initializes the log entry buffer | ||
| 150 | @iftex | ||
| 151 | (@pxref{Log Buffer,,,emacs, the Emacs Manual}) | ||
| 152 | @end iftex | ||
| 153 | @ifnottex | ||
| 154 | (@pxref{Log Buffer}) | ||
| 155 | @end ifnottex | ||
| 156 | to contain all the log entries you have recorded in the RCS master; | ||
| 157 | you can edit them as you wish, and then commit in CVS by typing | ||
| 158 | @kbd{C-c C-c}. If the commit is successful, VC removes the RCS | ||
| 159 | master, so that the file is once again registered under CVS only. | ||
| 160 | (The RCS master is not actually deleted, just renamed by appending | ||
| 161 | @samp{~} to the name, so that you can refer to it later if you wish.) | ||
| 162 | |||
| 163 | While using local RCS, you can pick up recent changes from the CVS | ||
| 164 | repository into your local file, or commit some of your changes back | ||
| 165 | to CVS, without terminating local RCS version control. To do this, | ||
| 166 | switch to the CVS back end temporarily, with the @kbd{C-x v b} command: | ||
| 167 | |||
| 168 | @table @kbd | ||
| 169 | @item C-x v b | ||
| 170 | Switch to another back end that the current file is registered | ||
| 171 | under (@code{vc-switch-backend}). | ||
| 172 | |||
| 173 | @item C-u C-x v b @var{backend} @key{RET} | ||
| 174 | Switch to @var{backend} for the current file. | ||
| 175 | @end table | ||
| 176 | |||
| 177 | @kindex C-x v b | ||
| 178 | @findex vc-switch-backend | ||
| 179 | @kbd{C-x v b} does not change the buffer contents, or any files; it | ||
| 180 | only changes VC's perspective on how to handle the file. Any | ||
| 181 | subsequent VC commands for that file will operate on the back end that | ||
| 182 | is currently selected. | ||
| 183 | |||
| 184 | If the current file is registered in more than one back end, typing | ||
| 185 | @kbd{C-x v b} ``cycles'' through all of these back ends. With a | ||
| 186 | prefix argument, it asks for the back end to use in the minibuffer. | ||
| 187 | |||
| 188 | Thus, if you are using local RCS, and you want to pick up some recent | ||
| 189 | changes in the file from remote CVS, first visit the file, then type | ||
| 190 | @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m | ||
| 191 | @key{RET}} to merge the news | ||
| 192 | @iftex | ||
| 193 | (@pxref{Merging,,,emacs, the Emacs Manual}). | ||
| 194 | @end iftex | ||
| 195 | @ifnottex | ||
| 196 | (@pxref{Merging}). | ||
| 197 | @end ifnottex | ||
| 198 | You can then switch back to RCS by typing @kbd{C-x v b} again, and | ||
| 199 | continue to edit locally. | ||
| 200 | |||
| 201 | But if you do this, the revision numbers in the RCS master no longer | ||
| 202 | correspond to those of CVS. Technically, this is not a problem, but | ||
| 203 | it can become difficult to keep track of what is in the CVS repository | ||
| 204 | and what is not. So we suggest that you return from time to time to | ||
| 205 | CVS-only operation, by committing your local changes back to the | ||
| 206 | repository using @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 207 | |||
| 208 | @node Revision Tags | ||
| 209 | @subsection Revision Tags | ||
| 210 | @cindex tags and version control | ||
| 211 | |||
| 212 | In a VCS with per-file revision numbers (such as SCCS, RCS, or CVS) | ||
| 213 | @dfn{tag} is a named set of file versions (one for each registered | ||
| 214 | file) that you can treat as a unit. In a VCS with per-repository | ||
| 215 | version numbers (Subversion and most later ones) a tag is simply | ||
| 216 | a symbolic name for a revision. | ||
| 217 | |||
| 218 | One important kind of tag is a @dfn{release}, a (theoretically) | ||
| 219 | stable version of the system that is ready for distribution to users. | ||
| 220 | |||
| 221 | @menu | ||
| 222 | * Making Revision Tags:: The tag facilities. | ||
| 223 | * Revision Tag Caveats:: Things to be careful of when using tags. | ||
| 224 | @end menu | ||
| 225 | |||
| 226 | @node Making Revision Tags | ||
| 227 | @subsubsection Making and Using Revision Tags | ||
| 228 | |||
| 229 | There are two basic commands for tags; one makes a | ||
| 230 | tag with a given name, the other retrieves a named tag. | ||
| 231 | |||
| 232 | @table @code | ||
| 233 | @kindex C-x v s | ||
| 234 | @findex vc-create-tag | ||
| 235 | @item C-x v s @var{name} @key{RET} | ||
| 236 | Define the working revision of every registered file in or under the | ||
| 237 | current directory as a tag named @var{name} | ||
| 238 | (@code{vc-create-tag}). | ||
| 239 | |||
| 240 | @kindex C-x v r | ||
| 241 | @findex vc-retrieve-tag | ||
| 242 | @item C-x v r @var{name} @key{RET} | ||
| 243 | For all registered files at or below the current directory level, | ||
| 244 | retrieve the tagged revision @var{name}. This command will | ||
| 245 | switch to a branch if @var{name} is a branch name and your VCS | ||
| 246 | distinguishes branches from tags. | ||
| 247 | (@code{vc-retrieve-tag}). | ||
| 248 | |||
| 249 | This command reports an error if any files are locked at or below the | ||
| 250 | current directory, without changing anything; this is to avoid | ||
| 251 | overwriting work in progress. | ||
| 252 | @end table | ||
| 253 | |||
| 254 | Tags are inexpensive, so you need not hesitate to create them whenever | ||
| 255 | they are useful. Branches vary in cost depending on your VCS; in | ||
| 256 | older ones they may be expensive. | ||
| 257 | |||
| 258 | You can give a tag or branch name as an argument to @kbd{C-x v =} or | ||
| 259 | @kbd{C-x v ~} | ||
| 260 | @iftex | ||
| 261 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}). | ||
| 262 | @end iftex | ||
| 263 | @ifnottex | ||
| 264 | (@pxref{Old Revisions}). | ||
| 265 | @end ifnottex | ||
| 266 | Thus, you can use it to compare a tagged version against the current files, | ||
| 267 | or two tagged versions against each other. | ||
| 268 | |||
| 269 | @node Revision Tag Caveats | ||
| 270 | @subsubsection Revision Tag Caveats | ||
| 271 | |||
| 272 | For SCCS, VC implements tags itself; these tags are visible only | ||
| 273 | through VC. Most later systems (including CVS, Subversion, bzr, git, | ||
| 274 | and hg) have a native tag facility, and VC uses it where | ||
| 275 | available; those tags will be visible even when you bypass VC. | ||
| 276 | |||
| 277 | There is no support for VC tags using GNU Arch yet. | ||
| 278 | |||
| 279 | Under older VCSes (SCCS, RCS, CVS, early versions of Subversion), | ||
| 280 | renaming and deletion could create some difficulties with tags. This is | ||
| 281 | not a VC-specific problem, but a general design issue in version | ||
| 282 | control systems that was not solved effectively until the earliest | ||
| 283 | third-generation systems. | ||
| 284 | |||
| 285 | In a file-oriented VCS, when you rename a registered file you need | ||
| 286 | to rename its master along with it; the command @code{vc-rename-file} | ||
| 287 | will do this automatically. If you are using SCCS, you must also | ||
| 288 | update the records of the tag, to mention the file by its new name | ||
| 289 | (@code{vc-rename-file} does this, too). An old tag that refers to a | ||
| 290 | master file that no longer exists under the recorded name is invalid; | ||
| 291 | VC can no longer retrieve it. It would be beyond the scope of this | ||
| 292 | manual to explain enough about RCS and SCCS to explain how to update | ||
| 293 | the tags by hand. | ||
| 294 | |||
| 295 | Using @code{vc-rename-file} makes the tag remain valid for | ||
| 296 | retrieval, but it does not solve all problems. For example, some of the | ||
| 297 | files in your program probably refer to others by name. At the very | ||
| 298 | least, the makefile probably mentions the file that you renamed. If you | ||
| 299 | retrieve an old tag, the renamed file is retrieved under its new | ||
| 300 | name, which is not the name that the makefile expects. So the program | ||
| 301 | won't really work as retrieved. | ||
| 302 | |||
| 303 | @node Miscellaneous VC | 8 | @node Miscellaneous VC |
| 304 | @subsection Miscellaneous Commands and Features of VC | 9 | @subsection Miscellaneous Commands and Features of VC |
| 305 | 10 | ||
| @@ -309,50 +14,54 @@ won't really work as retrieved. | |||
| 309 | * Change Logs and VC:: Generating a change log file from log entries. | 14 | * Change Logs and VC:: Generating a change log file from log entries. |
| 310 | * Renaming and VC:: A command to rename both the source and master | 15 | * Renaming and VC:: A command to rename both the source and master |
| 311 | file correctly. | 16 | file correctly. |
| 17 | * Revision Tags:: Symbolic names for revisions. | ||
| 312 | * Version Headers:: Inserting version control headers into working files. | 18 | * Version Headers:: Inserting version control headers into working files. |
| 313 | @end menu | 19 | @end menu |
| 314 | 20 | ||
| 315 | @node Change Logs and VC | 21 | @node Change Logs and VC |
| 316 | @subsubsection Change Logs and VC | 22 | @subsubsection Change Logs and VC |
| 317 | 23 | ||
| 318 | If you use RCS or CVS for a program and also maintain a change log | 24 | If you use RCS or CVS for a program with a @file{ChangeLog} file |
| 319 | file for it | ||
| 320 | @iftex | 25 | @iftex |
| 321 | (@pxref{Change Log,,,emacs, the Emacs Manual}), | 26 | (@pxref{Change Log,,,emacs, the Emacs Manual}), |
| 322 | @end iftex | 27 | @end iftex |
| 323 | @ifnottex | 28 | @ifnottex |
| 324 | (@pxref{Change Log}), | 29 | (@pxref{Change Log}), |
| 325 | @end ifnottex | 30 | @end ifnottex |
| 326 | you can generate change log entries automatically from the version | 31 | you can generate change log entries from the version control log |
| 327 | control log entries: | 32 | entries of previous commits. |
| 33 | |||
| 34 | Note that this only works with RCS or CVS. This procedure would be | ||
| 35 | particularly incorrect on a modern changeset-based version control | ||
| 36 | system, where changes to the @file{ChangeLog} file would normally be | ||
| 37 | committed as part of a changeset. In that case, you should write the | ||
| 38 | change log entries first, then pull them into the @samp{*vc-log*} | ||
| 39 | buffer when you commit | ||
| 40 | @iftex | ||
| 41 | (@pxref{Log Buffer,,,emacs, the Emacs Manual}). | ||
| 42 | @end iftex | ||
| 43 | @ifnottex | ||
| 44 | (@pxref{Log Buffer}). | ||
| 45 | @end ifnottex | ||
| 328 | 46 | ||
| 329 | @table @kbd | 47 | @table @kbd |
| 330 | @item C-x v a | 48 | @item C-x v a |
| 331 | @kindex C-x v a | 49 | @kindex C-x v a |
| 332 | @findex vc-update-change-log | 50 | @findex vc-update-change-log |
| 333 | Visit the current directory's change log file and, for registered files | 51 | Visit the current directory's @file{ChangeLog} file and, for |
| 334 | in that directory, create new entries for versions checked in since the | 52 | registered files in that directory, create new entries for versions |
| 335 | most recent entry in the change log file. | 53 | committed since the most recent change log entry |
| 336 | (@code{vc-update-change-log}). | 54 | (@code{vc-update-change-log}). |
| 337 | 55 | ||
| 338 | This command works with RCS or CVS only, not with any of the other | ||
| 339 | back ends. | ||
| 340 | |||
| 341 | @item C-u C-x v a | 56 | @item C-u C-x v a |
| 342 | As above, but only find entries for the current buffer's file. | 57 | As above, but only find entries for the current buffer's file. |
| 343 | |||
| 344 | @item M-1 C-x v a | ||
| 345 | As above, but find entries for all the currently visited files that are | ||
| 346 | maintained with version control. This works only with RCS, and it puts | ||
| 347 | all entries in the log for the default directory, which may not be | ||
| 348 | appropriate. | ||
| 349 | @end table | 58 | @end table |
| 350 | 59 | ||
| 351 | For example, suppose the first line of @file{ChangeLog} is dated | 60 | For example, suppose the first line of @file{ChangeLog} is dated |
| 352 | 1999-04-10, and that the only check-in since then was by Nathaniel | 61 | 1999-04-10, and that the only check-in since then was by Nathaniel |
| 353 | Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log | 62 | Bowditch to @file{rcs2log} on 1999-05-22 with log entry @samp{Ignore |
| 354 | messages that start with `#'.}. Then @kbd{C-x v a} visits | 63 | log messages that start with `#'.}. Then @kbd{C-x v a} inserts this |
| 355 | @file{ChangeLog} and inserts text like this: | 64 | @file{ChangeLog} entry: |
| 356 | 65 | ||
| 357 | @iftex | 66 | @iftex |
| 358 | @medbreak | 67 | @medbreak |
| @@ -369,17 +78,11 @@ messages that start with `#'.}. Then @kbd{C-x v a} visits | |||
| 369 | @end iftex | 78 | @end iftex |
| 370 | 79 | ||
| 371 | @noindent | 80 | @noindent |
| 372 | You can then edit the new change log entry further as you wish. | 81 | If the version control log entry specifies a function name (in |
| 373 | 82 | parenthesis at the beginning of a line), that is reflected in the | |
| 374 | Some of the new change log entries may duplicate what's already in | 83 | @file{ChangeLog} entry. For example, if a log entry for @file{vc.el} |
| 375 | ChangeLog. You will have to remove these duplicates by hand. | 84 | is @samp{(vc-do-command): Check call-process status.}, the |
| 376 | 85 | @file{ChangeLog} entry is: | |
| 377 | Normally, the log entry for file @file{foo} is displayed as @samp{* | ||
| 378 | foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | ||
| 379 | if the text of the log entry starts with @w{@samp{(@var{functionname}): | ||
| 380 | }}. For example, if the log entry for @file{vc.el} is | ||
| 381 | @samp{(vc-do-command): Check call-process status.}, then the text in | ||
| 382 | @file{ChangeLog} looks like this: | ||
| 383 | 86 | ||
| 384 | @iftex | 87 | @iftex |
| 385 | @medbreak | 88 | @medbreak |
| @@ -395,92 +98,108 @@ if the text of the log entry starts with @w{@samp{(@var{functionname}): | |||
| 395 | @medbreak | 98 | @medbreak |
| 396 | @end iftex | 99 | @end iftex |
| 397 | 100 | ||
| 398 | When @kbd{C-x v a} adds several change log entries at once, it groups | 101 | When @kbd{C-x v a} adds several change log entries at once, it |
| 399 | related log entries together if they all are checked in by the same | 102 | groups related log entries together if they all are checked in by the |
| 400 | author at nearly the same time. If the log entries for several such | 103 | same author at nearly the same time. If the log entries for several |
| 401 | files all have the same text, it coalesces them into a single entry. | 104 | such files all have the same text, it coalesces them into a single |
| 402 | For example, suppose the most recent check-ins have the following log | 105 | entry. |
| 403 | entries: | ||
| 404 | 106 | ||
| 405 | @flushleft | 107 | @node Renaming and VC |
| 406 | @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} | 108 | @subsubsection Renaming VC Work Files and Master Files |
| 407 | @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} | 109 | @cindex renaming version-controlled files |
| 408 | @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} | ||
| 409 | @end flushleft | ||
| 410 | 110 | ||
| 411 | @noindent | 111 | @table @kbd |
| 412 | They appear like this in @file{ChangeLog}: | 112 | @item M-x vc-rename-file |
| 113 | Prompt for two file names, @var{VAR} and @var{OLD}, and rename them in | ||
| 114 | the version-controlled working tree. | ||
| 115 | @end table | ||
| 413 | 116 | ||
| 414 | @iftex | 117 | @findex vc-rename-file |
| 415 | @medbreak | 118 | If you wish to rename a registered file in a version-controlled |
| 416 | @end iftex | 119 | working tree, use the command @kbd{M-x vc-rename-file}. This prompts |
| 417 | @smallexample | 120 | for two arguments: the file you wish to rename, followed by the new |
| 418 | @group | 121 | name; then it performs the renaming through the version control |
| 419 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | 122 | system. |
| 123 | |||
| 124 | On modern version control systems that have built-in support for | ||
| 125 | renaming, the renaming operation takes effect immediately in the | ||
| 126 | working tree, and takes effect in the repository when you commit the | ||
| 127 | renamed file. The renamed file retains the full change history of the | ||
| 128 | original file. | ||
| 129 | |||
| 130 | On CVS and older version control systems, the @code{vc-rename-file} | ||
| 131 | command actually works by creating a copy of the old file under the | ||
| 132 | new name, registering it, and deleting the old file. In this case, | ||
| 133 | the change history is not preserved. | ||
| 420 | 134 | ||
| 421 | * vc.texinfo: Fix expansion typos. | 135 | @node Revision Tags |
| 136 | @subsubsection Revision Tags | ||
| 137 | @cindex revision tag | ||
| 138 | @cindex tags for version control | ||
| 422 | 139 | ||
| 423 | * vc.el, vc-hooks.el: Don't call expand-file-name. | 140 | Most version control systems allow you to apply a @dfn{revision tag} |
| 424 | @end group | 141 | to a specific version of a version-controlled tree. On modern |
| 425 | @end smallexample | 142 | changeset-based version control systems, a revision tag is simply a |
| 426 | @iftex | 143 | symbolic name for a particular revision. On older file-based systems |
| 427 | @medbreak | 144 | like CVS, each tag is added to the entire set of version-controlled |
| 428 | @end iftex | 145 | files, allowing them to be handled as a unit. Revision tags are |
| 146 | commonly used to identify releases that are distributed to users. | ||
| 429 | 147 | ||
| 430 | Normally, @kbd{C-x v a} separates log entries by a blank line, but you | 148 | There are two basic commands for tags; one makes a tag with a given |
| 431 | can mark several related log entries to be clumped together (without an | 149 | name, the other retrieves a named tag. |
| 432 | intervening blank line) by starting the text of each related log entry | ||
| 433 | with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label | ||
| 434 | itself is not copied to @file{ChangeLog}. For example, suppose the log | ||
| 435 | entries are: | ||
| 436 | 150 | ||
| 437 | @flushleft | 151 | @table @code |
| 438 | @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} | 152 | @kindex C-x v s |
| 439 | @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} | 153 | @findex vc-create-tag |
| 440 | @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} | 154 | @item C-x v s @var{name} @key{RET} |
| 441 | @end flushleft | 155 | Define the working revision of every registered file in or under the |
| 156 | current directory as a tag named @var{name} | ||
| 157 | (@code{vc-create-tag}). | ||
| 442 | 158 | ||
| 443 | @noindent | 159 | @kindex C-x v r |
| 444 | Then the text in @file{ChangeLog} looks like this: | 160 | @findex vc-retrieve-tag |
| 161 | @item C-x v r @var{name} @key{RET} | ||
| 162 | For all registered files at or below the current directory level, | ||
| 163 | retrieve the tagged revision @var{name}. This command will switch to a | ||
| 164 | branch if @var{name} is a branch name and your VCS distinguishes | ||
| 165 | branches from tags. (@code{vc-retrieve-tag}). | ||
| 445 | 166 | ||
| 446 | @iftex | 167 | This command reports an error if any files are locked at or below the |
| 447 | @medbreak | 168 | current directory, without changing anything; this is to avoid |
| 448 | @end iftex | 169 | overwriting work in progress. |
| 449 | @smallexample | 170 | @end table |
| 450 | @group | ||
| 451 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 452 | 171 | ||
| 453 | * vc.texinfo: Fix expansion typos. | 172 | You can give a tag or branch name as an argument to @kbd{C-x v =} or |
| 454 | * vc.el, vc-hooks.el: Don't call expand-file-name. | 173 | @kbd{C-x v ~} |
| 455 | @end group | ||
| 456 | @end smallexample | ||
| 457 | @iftex | 174 | @iftex |
| 458 | @medbreak | 175 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}). |
| 459 | @end iftex | 176 | @end iftex |
| 177 | @ifnottex | ||
| 178 | (@pxref{Old Revisions}). | ||
| 179 | @end ifnottex | ||
| 180 | Thus, you can use it to compare a tagged version against the current files, | ||
| 181 | or two tagged versions against each other. | ||
| 460 | 182 | ||
| 461 | A log entry whose text begins with @samp{#} is not copied to | 183 | On SCCS, VC implements tags itself; these tags are visible only |
| 462 | @file{ChangeLog}. For example, if you merely fix some misspellings in | 184 | through VC. Most later systems (including CVS, Subversion, bzr, git, |
| 463 | comments, you can log the change with an entry beginning with @samp{#} | 185 | and hg) have a native tag facility, and VC uses it where available; |
| 464 | to avoid putting such trivia into @file{ChangeLog}. | 186 | those tags will be visible even when you bypass VC. |
| 465 | |||
| 466 | @node Renaming and VC | ||
| 467 | @subsubsection Renaming VC Work Files and Master Files | ||
| 468 | |||
| 469 | @findex vc-rename-file | ||
| 470 | When you rename a registered file, you must also rename its master | ||
| 471 | file correspondingly to get proper results. Use @code{vc-rename-file} | ||
| 472 | to rename the source file as you specify, and rename its master file | ||
| 473 | accordingly. It also updates any tags (@pxref{Revision Tags}) that | ||
| 474 | mention the file, so that they use the new name; despite this, the | ||
| 475 | tag thus modified may not completely work (@pxref{Revision Tag Caveats}). | ||
| 476 | |||
| 477 | Some back ends do not provide an explicit rename operation to their | ||
| 478 | repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} | ||
| 479 | on the original and renamed buffers and provide the necessary edit | ||
| 480 | log. | ||
| 481 | 187 | ||
| 482 | You cannot use @code{vc-rename-file} on a file that is locked by | 188 | In a file-oriented VCS, when you rename a registered file you need |
| 483 | someone else. | 189 | to rename its master along with it; the command @code{vc-rename-file} |
| 190 | will do this automatically. If you are using SCCS, you must also | ||
| 191 | update the records of the tag, to mention the file by its new name | ||
| 192 | (@code{vc-rename-file} does this, too). An old tag that refers to a | ||
| 193 | master file that no longer exists under the recorded name is invalid; | ||
| 194 | VC can no longer retrieve it. It would be beyond the scope of this | ||
| 195 | manual to explain enough about RCS and SCCS to explain how to update | ||
| 196 | the tags by hand. Using @code{vc-rename-file} makes the tag remain | ||
| 197 | valid for retrieval, but it does not solve all problems. For example, | ||
| 198 | some of the files in your program probably refer to others by name. | ||
| 199 | At the very least, the makefile probably mentions the file that you | ||
| 200 | renamed. If you retrieve an old tag, the renamed file is retrieved | ||
| 201 | under its new name, which is not the name that the makefile expects. | ||
| 202 | So the program won't really work as retrieved. | ||
| 484 | 203 | ||
| 485 | @node Version Headers | 204 | @node Version Headers |
| 486 | @subsubsection Inserting Version Control Headers | 205 | @subsubsection Inserting Version Control Headers |
| @@ -592,10 +311,9 @@ these systems, exclude its name from the list. To disable VC entirely, | |||
| 592 | set this variable to @code{nil}. | 311 | set this variable to @code{nil}. |
| 593 | 312 | ||
| 594 | The order of systems in the list is significant: when you visit a file | 313 | The order of systems in the list is significant: when you visit a file |
| 595 | registered in more than one system (@pxref{Local Version Control}), VC | 314 | registered in more than one system, VC uses the system that comes |
| 596 | uses the system that comes first in @code{vc-handled-backends} by | 315 | first in @code{vc-handled-backends} by default. The order is also |
| 597 | default. The order is also significant when you register a file for | 316 | significant when you register a file for the first time, see |
| 598 | the first time, see | ||
| 599 | @iftex | 317 | @iftex |
| 600 | @ref{Registering,,,emacs, the Emacs Manual}, | 318 | @ref{Registering,,,emacs, the Emacs Manual}, |
| 601 | @end iftex | 319 | @end iftex |
| @@ -708,37 +426,16 @@ the variable @code{vc-mistrust-permissions} affects SCCS use, but | |||
| 708 | @node CVS Options | 426 | @node CVS Options |
| 709 | @subsubsection Options specific for CVS | 427 | @subsubsection Options specific for CVS |
| 710 | 428 | ||
| 711 | @cindex locking (CVS) | 429 | @vindex vc-cvs-global-switches |
| 712 | By default, CVS does not use locking to coordinate the activities of | 430 | You can specify additional command line options to pass to all CVS |
| 713 | several users; anyone can change a work file at any time. However, | 431 | operations in the variable @code{vc-cvs-global-switches}. These |
| 714 | there are ways to restrict this, resulting in behavior that resembles | 432 | switches are inserted immediately after the @code{cvs} command, before |
| 715 | locking. | 433 | the name of the operation to invoke. |
| 716 | |||
| 717 | @cindex CVSREAD environment variable (CVS) | ||
| 718 | For one thing, you can set the @env{CVSREAD} environment variable | ||
| 719 | (the value you use makes no difference). If this variable is defined, | ||
| 720 | CVS makes your work files read-only by default. In Emacs, you must | ||
| 721 | type @kbd{C-x v v} to make the file writable, so that editing works | ||
| 722 | in fact similar as if locking was used. Note however, that no actual | ||
| 723 | locking is performed, so several users can make their files writable | ||
| 724 | at the same time. When setting @env{CVSREAD} for the first time, make | ||
| 725 | sure to check out all your modules anew, so that the file protections | ||
| 726 | are set correctly. | ||
| 727 | |||
| 728 | @cindex cvs watch feature | ||
| 729 | @cindex watching files (CVS) | ||
| 730 | Another way to achieve something similar to locking is to use the | ||
| 731 | @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | ||
| 732 | read-only by default, and you must also use @kbd{C-x v v} in Emacs to | ||
| 733 | make it writable. VC calls @code{cvs edit} to make the file writable, | ||
| 734 | and CVS takes care to notify other developers of the fact that you | ||
| 735 | intend to change the file. See the CVS documentation for details on | ||
| 736 | using the watch feature. | ||
| 737 | 434 | ||
| 738 | @vindex vc-stay-local | 435 | @vindex vc-stay-local |
| 739 | @vindex vc-cvs-stay-local | 436 | @vindex vc-cvs-stay-local |
| 740 | @cindex remote repositories (CVS) | 437 | @cindex remote repositories (CVS) |
| 741 | When a file's repository is on a remote machine, VC tries to keep | 438 | When using a CVS repository on a remote machine, VC can try keeping |
| 742 | network interactions to a minimum. This is controlled by the variable | 439 | network interactions to a minimum. This is controlled by the variable |
| 743 | @code{vc-cvs-stay-local}. There is another variable, | 440 | @code{vc-cvs-stay-local}. There is another variable, |
| 744 | @code{vc-stay-local}, which enables the feature also for other back | 441 | @code{vc-stay-local}, which enables the feature also for other back |
| @@ -746,36 +443,58 @@ ends that support it, including CVS. In the following, we will talk | |||
| 746 | only about @code{vc-cvs-stay-local}, but everything applies to | 443 | only about @code{vc-cvs-stay-local}, but everything applies to |
| 747 | @code{vc-stay-local} as well. | 444 | @code{vc-stay-local} as well. |
| 748 | 445 | ||
| 749 | If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses | 446 | If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines |
| 750 | only the entry in the local CVS subdirectory to determine the file's | 447 | the version control status of each file using only the entry in the |
| 751 | state (and possibly information returned by previous CVS commands). | 448 | local CVS subdirectory and the information returned by previous CVS |
| 752 | One consequence of this is that when you have modified a file, and | 449 | commands. As a consequence, if you have modified a file and somebody |
| 753 | somebody else has already checked in other changes to the file, you | 450 | else has checked in other changes, you will not be notified of the |
| 754 | are not notified of it until you actually try to commit. (But you can | 451 | conflict until you try to commit. |
| 755 | try to pick up any recent changes from the repository first, using | 452 | |
| 756 | @kbd{C-x v m @key{RET}}, | 453 | If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the |
| 454 | remote repository @emph{before} it decides what to do in | ||
| 455 | @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 456 | repositories. | ||
| 457 | |||
| 458 | You can also set @code{vc-cvs-stay-local} to a regular expression | ||
| 459 | that is matched against the repository host name; VC then stays local | ||
| 460 | only for repositories from hosts that match the pattern. | ||
| 461 | |||
| 462 | @cindex automatic version backups | ||
| 463 | When using a remote repository, Emacs normally makes @dfn{automatic | ||
| 464 | version backups} of the original versions of each edited file. These | ||
| 465 | local backups are made whenever you save the first changes to a file, | ||
| 466 | and they are removed after you commit your changes to the repository. | ||
| 467 | (Note that these are not the same as ordinary Emacs backup files; | ||
| 757 | @iftex | 468 | @iftex |
| 758 | @pxref{Merging,,,emacs, the Emacs Manual}). | 469 | @pxref{Backup,,,emacs, the Emacs Manual}.) |
| 759 | @end iftex | 470 | @end iftex |
| 760 | @ifnottex | 471 | @ifnottex |
| 761 | @pxref{Merging}). | 472 | @pxref{Backup}.) |
| 762 | @end ifnottex | 473 | @end ifnottex |
| 474 | Commands like @kbd{C-x v =} and @kbd{C-x v u} make use of automatic | ||
| 475 | version backups, if possible, to avoid having to access the network. | ||
| 763 | 476 | ||
| 764 | When @code{vc-cvs-stay-local} is @code{t}, VC also makes local | 477 | Setting @code{vc-cvs-stay-local} to @code{nil} disables the making |
| 765 | version backups, so that simple diff and revert operations are | 478 | of automatic version backups. |
| 766 | completely local (@pxref{Version Backups}). | ||
| 767 | 479 | ||
| 768 | On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, | 480 | @cindex manual version backups |
| 769 | then VC queries the remote repository @emph{before} it decides what to | 481 | Automatic version backups have names of the form |
| 770 | do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | 482 | @w{@code{@var{file}.~@var{version}.~}}. This is similar to the name |
| 771 | repositories. It also does not make any version backups. | 483 | that @kbd{C-x v ~} saves old versions to |
| 772 | 484 | @iftex | |
| 773 | You can also set @code{vc-cvs-stay-local} to a regular expression | 485 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}), |
| 774 | that is matched against the repository host name; VC then stays local | 486 | @end iftex |
| 775 | only for repositories from hosts that match the pattern. | 487 | @ifnottex |
| 488 | (@pxref{Old Revisions}), | ||
| 489 | @end ifnottex | ||
| 490 | except for the additional dot (@samp{.}) after the version. The | ||
| 491 | relevant VC commands can use both kinds of version backups. The main | ||
| 492 | difference is that the ``manual'' version backups made by @kbd{C-x v | ||
| 493 | ~} are not deleted automatically when you commit. | ||
| 776 | 494 | ||
| 777 | @vindex vc-cvs-global-switches | 495 | @cindex locking (CVS) |
| 778 | You can specify additional command line options to pass to all CVS | 496 | CVS does not use locking by default, but there are ways to enable |
| 779 | operations in the variable @code{vc-cvs-global-switches}. These | 497 | locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; |
| 780 | switches are inserted immediately after the @code{cvs} command, before | 498 | see the CVS documentation for details. If that case, you can use |
| 781 | the name of the operation to invoke. | 499 | @kbd{C-x v v} in Emacs to toggle locking, as you would for a |
| 500 | locking-based version control system (@pxref{VC With A Locking VCS}). | ||