diff options
| author | Karl Berry | 2006-04-12 00:27:50 +0000 |
|---|---|---|
| committer | Karl Berry | 2006-04-12 00:27:50 +0000 |
| commit | 45ca30f2f426dc098b31ec04cd72c7581153475c (patch) | |
| tree | f6b81244ed37bd6a5533ba59049518fa3e7de1ac | |
| parent | 14e6dc54f295e1fbc92f6e22a5bb8b5f9a4b83ac (diff) | |
| download | emacs-45ca30f2f426dc098b31ec04cd72c7581153475c.tar.gz emacs-45ca30f2f426dc098b31ec04cd72c7581153475c.zip | |
move more advanced vc info to emacs-xtra.texi
| -rw-r--r-- | man/ChangeLog | 12 | ||||
| -rw-r--r-- | man/cmdargs.texi | 2 | ||||
| -rw-r--r-- | man/emacs-xtra.texi | 887 | ||||
| -rw-r--r-- | man/emacs.texi | 4 | ||||
| -rw-r--r-- | man/files.texi | 941 |
5 files changed, 940 insertions, 906 deletions
diff --git a/man/ChangeLog b/man/ChangeLog index 37543f5d8da..5123c1127ae 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2006-04-11 Karl Berry <karl@gnu.org> | ||
| 2 | |||
| 3 | * emacs-xtra.texi, emacs.texi (Dired under VC, VC Dired Commands, | ||
| 4 | Remote Repositories, Version Backups, Local Version Control, | ||
| 5 | Snapshots, Making and Using Snapshots, Snapshot Caveats, | ||
| 6 | Miscellaneous Commands and Features of VC, Change Logs and VC, | ||
| 7 | Renaming VC Work Files and Master Files, | ||
| 8 | Inserting Version Control Headers, Customizing VC, General Options, | ||
| 9 | Options for RCS and SCCS, Options specific for CVS): move all | ||
| 10 | these nodes to emacs-xtra.texi, for brevity. | ||
| 11 | * cmdargs.texi, files.texi: change cross-references. | ||
| 12 | |||
| 1 | 2006-04-11 Reiner Steib <Reiner.Steib@gmx.de> | 13 | 2006-04-11 Reiner Steib <Reiner.Steib@gmx.de> |
| 2 | 14 | ||
| 3 | * gnus.texi, gnus-faq.texi, message.texi: Gnus v5.10.8 is released. | 15 | * gnus.texi, gnus-faq.texi, message.texi: Gnus v5.10.8 is released. |
diff --git a/man/cmdargs.texi b/man/cmdargs.texi index f266913d266..f1e7c539f76 100644 --- a/man/cmdargs.texi +++ b/man/cmdargs.texi | |||
| @@ -551,7 +551,7 @@ The name of an interpreter used to parse and execute programs run from | |||
| 551 | inside Emacs. | 551 | inside Emacs. |
| 552 | @item SMTPSERVER | 552 | @item SMTPSERVER |
| 553 | The name of the outgoing mail server. Used by the SMTP library | 553 | The name of the outgoing mail server. Used by the SMTP library |
| 554 | (@pxref{Top,,Sending mail via SMTP,smtpmail}). | 554 | (@pxref{Top,,,Sending mail via SMTP,smtpmail}). |
| 555 | @cindex background mode, on @command{xterm} | 555 | @cindex background mode, on @command{xterm} |
| 556 | @item TERM | 556 | @item TERM |
| 557 | The type of the terminal that Emacs is using. This variable must be | 557 | The type of the terminal that Emacs is using. This variable must be |
diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi index 7f7574d05e5..d4a1e5f000e 100644 --- a/man/emacs-xtra.texi +++ b/man/emacs-xtra.texi | |||
| @@ -57,12 +57,14 @@ license to the document, as described in section 6 of the license. | |||
| 57 | @menu | 57 | @menu |
| 58 | * Introduction:: What documentation belongs here? | 58 | * Introduction:: What documentation belongs here? |
| 59 | * Autorevert:: Auto Reverting non-file buffers. | 59 | * Autorevert:: Auto Reverting non-file buffers. |
| 60 | * Subdir switches:: Subdirectory switches in Dired. | 60 | * Subdir Switches:: Subdirectory switches in Dired. |
| 61 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. | 61 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. |
| 62 | * Emerge:: A convenient way of merging two versions | 62 | * Emerge:: A convenient way of merging two versions |
| 63 | of a program. | 63 | of a program. |
| 64 | * Picture Mode:: Editing pictures made up of characters | 64 | * Picture Mode:: Editing pictures made up of characters |
| 65 | using the quarter-plane screen model. | 65 | using the quarter-plane screen model. |
| 66 | |||
| 67 | * Advanced VC Usage:: Advanced VC (version control) features. | ||
| 66 | * Fortran:: Fortran mode and its special features. | 68 | * Fortran:: Fortran mode and its special features. |
| 67 | * MS-DOG:: | 69 | * MS-DOG:: |
| 68 | * Index:: | 70 | * Index:: |
| @@ -273,7 +275,7 @@ for the buffer reliably assures that all information in the buffer is | |||
| 273 | completely up to date (or will be after @code{auto-revert-interval} | 275 | completely up to date (or will be after @code{auto-revert-interval} |
| 274 | seconds). | 276 | seconds). |
| 275 | 277 | ||
| 276 | @node Subdir switches | 278 | @node Subdir Switches |
| 277 | @chapter Subdirectory Switches in Dired | 279 | @chapter Subdirectory Switches in Dired |
| 278 | 280 | ||
| 279 | You can insert subdirectories with specified @code{ls} switches in | 281 | You can insert subdirectories with specified @code{ls} switches in |
| @@ -1889,6 +1891,887 @@ other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts | |||
| 1889 | @kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does | 1891 | @kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does |
| 1890 | likewise for the rectangle found in a specified register. | 1892 | likewise for the rectangle found in a specified register. |
| 1891 | 1893 | ||
| 1894 | @node Advanced VC Usage | ||
| 1895 | @chapter Advanced VC Usage | ||
| 1896 | |||
| 1897 | Commonly used features of Emacs' version control (VC) support are | ||
| 1898 | described in the main Emacs manual (@pxref{Version Control,,,emacs, | ||
| 1899 | the Emacs Manual}). This chapter describes more advanced VC usage. | ||
| 1900 | |||
| 1901 | @menu | ||
| 1902 | * VC Dired Mode:: Listing files managed by version control. | ||
| 1903 | * VC Dired Commands:: Commands to use in a VC Dired buffer. | ||
| 1904 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 1905 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 1906 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 1907 | * Customizing VC:: Variables that change VC's behavior. | ||
| 1908 | @end menu | ||
| 1909 | |||
| 1910 | @node VC Dired Mode | ||
| 1911 | @section Dired under VC | ||
| 1912 | |||
| 1913 | @cindex PCL-CVS | ||
| 1914 | @pindex cvs | ||
| 1915 | @cindex CVS Dired Mode | ||
| 1916 | The VC Dired Mode described here works with all the version control | ||
| 1917 | systems that VC supports. Another more powerful facility, designed | ||
| 1918 | specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS, | ||
| 1919 | pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. | ||
| 1920 | |||
| 1921 | @kindex C-x v d | ||
| 1922 | @findex vc-directory | ||
| 1923 | When you are working on a large program, it is often useful to find | ||
| 1924 | out which files have changed within an entire directory tree, or to view | ||
| 1925 | the status of all files under version control at once, and to perform | ||
| 1926 | version control operations on collections of files. You can use the | ||
| 1927 | command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing | ||
| 1928 | that includes only files relevant for version control. | ||
| 1929 | |||
| 1930 | @vindex vc-dired-terse-display | ||
| 1931 | @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks | ||
| 1932 | much like an ordinary Dired buffer (@pxref{Dired,,,emacs, the | ||
| 1933 | Emacs Manual}); however, normally it shows only the noteworthy files | ||
| 1934 | (those locked or not up-to-date). This is called @dfn{terse display}. | ||
| 1935 | If you set the variable @code{vc-dired-terse-display} to @code{nil}, | ||
| 1936 | then VC Dired shows all relevant files---those managed under version | ||
| 1937 | control, plus all subdirectories (@dfn{full display}). The command | ||
| 1938 | @kbd{v t} in a VC Dired buffer toggles between terse display and full | ||
| 1939 | display (@pxref{VC Dired Commands}). | ||
| 1940 | |||
| 1941 | @vindex vc-dired-recurse | ||
| 1942 | By default, VC Dired produces a recursive listing of noteworthy or | ||
| 1943 | relevant files at or below the given directory. You can change this by | ||
| 1944 | setting the variable @code{vc-dired-recurse} to @code{nil}; then VC | ||
| 1945 | Dired shows only the files in the given directory. | ||
| 1946 | |||
| 1947 | The line for an individual file shows the version control state in the | ||
| 1948 | place of the hard link count, owner, group, and size of the file. If | ||
| 1949 | the file is unmodified, in sync with the master file, the version | ||
| 1950 | control state shown is blank. Otherwise it consists of text in | ||
| 1951 | parentheses. Under RCS and SCCS, the name of the user locking the file | ||
| 1952 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 1953 | output is used. Here is an example using RCS: | ||
| 1954 | |||
| 1955 | @smallexample | ||
| 1956 | @group | ||
| 1957 | /home/jim/project: | ||
| 1958 | |||
| 1959 | -rw-r--r-- (jim) Apr 2 23:39 file1 | ||
| 1960 | -r--r--r-- Apr 5 20:21 file2 | ||
| 1961 | @end group | ||
| 1962 | @end smallexample | ||
| 1963 | |||
| 1964 | @noindent | ||
| 1965 | The files @samp{file1} and @samp{file2} are under version control, | ||
| 1966 | @samp{file1} is locked by user jim, and @samp{file2} is unlocked. | ||
| 1967 | |||
| 1968 | Here is an example using CVS: | ||
| 1969 | |||
| 1970 | @smallexample | ||
| 1971 | @group | ||
| 1972 | /home/joe/develop: | ||
| 1973 | |||
| 1974 | -rw-r--r-- (modified) Aug 2 1997 file1.c | ||
| 1975 | -rw-r--r-- Apr 4 20:09 file2.c | ||
| 1976 | -rw-r--r-- (merge) Sep 13 1996 file3.c | ||
| 1977 | @end group | ||
| 1978 | @end smallexample | ||
| 1979 | |||
| 1980 | Here @samp{file1.c} is modified with respect to the repository, and | ||
| 1981 | @samp{file2.c} is not. @samp{file3.c} is modified, but other changes | ||
| 1982 | have also been checked in to the repository---you need to merge them | ||
| 1983 | with the work file before you can check it in. | ||
| 1984 | |||
| 1985 | @vindex vc-stay-local | ||
| 1986 | @vindex vc-cvs-stay-local | ||
| 1987 | In the above, if the repository were on a remote machine, VC would | ||
| 1988 | only contact it when the variable @code{vc-stay-local} (or | ||
| 1989 | @code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is | ||
| 1990 | because access to the repository may be slow, or you may be working | ||
| 1991 | offline and not have access to the repository at all. As a | ||
| 1992 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 1993 | in the ``merge'' state; you would learn that only when you try to | ||
| 1994 | check-in your modified copy of the file, or use a command such as | ||
| 1995 | @kbd{C-x v m}. | ||
| 1996 | |||
| 1997 | In practice, this is not a problem because CVS handles this case | ||
| 1998 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 1999 | merge the remote changes into your work file first. The benefits of | ||
| 2000 | less network communication usually outweigh the disadvantage of not | ||
| 2001 | seeing remote changes immediately. | ||
| 2002 | |||
| 2003 | @vindex vc-directory-exclusion-list | ||
| 2004 | When VC Dired displays subdirectories (in the ``full'' display mode), | ||
| 2005 | it omits some that should never contain any files under version control. | ||
| 2006 | By default, this includes Version Control subdirectories such as | ||
| 2007 | @samp{RCS} and @samp{CVS}; you can customize this by setting the | ||
| 2008 | variable @code{vc-directory-exclusion-list}. | ||
| 2009 | |||
| 2010 | You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in | ||
| 2011 | ordinary Dired, that allows you to specify additional switches for the | ||
| 2012 | @samp{ls} command. | ||
| 2013 | |||
| 2014 | @node VC Dired Commands | ||
| 2015 | @section VC Dired Commands | ||
| 2016 | |||
| 2017 | All the usual Dired commands work normally in VC Dired mode, except | ||
| 2018 | for @kbd{v}, which is redefined as the version control prefix. You can | ||
| 2019 | invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by | ||
| 2020 | typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply | ||
| 2021 | to the file name on the current line. | ||
| 2022 | |||
| 2023 | The command @kbd{v v} (@code{vc-next-action}) operates on all the | ||
| 2024 | marked files, so that you can lock or check in several files at once. | ||
| 2025 | If it operates on more than one file, it handles each file according to | ||
| 2026 | its current state; thus, it might lock one file, but check in another | ||
| 2027 | file. This could be confusing; it is up to you to avoid confusing | ||
| 2028 | behavior by marking a set of files that are in a similar state. If no | ||
| 2029 | files are marked, @kbd{v v} operates on the file in the current line. | ||
| 2030 | |||
| 2031 | If any files call for check-in, @kbd{v v} reads a single log entry, | ||
| 2032 | then uses it for all the files being checked in. This is convenient for | ||
| 2033 | registering or checking in several files at once, as part of the same | ||
| 2034 | change. | ||
| 2035 | |||
| 2036 | @findex vc-dired-toggle-terse-mode | ||
| 2037 | @findex vc-dired-mark-locked | ||
| 2038 | You can toggle between terse display (only locked files, or files not | ||
| 2039 | up-to-date) and full display at any time by typing @kbd{v t} | ||
| 2040 | (@code{vc-dired-toggle-terse-mode}). There is also a special command | ||
| 2041 | @kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently | ||
| 2042 | locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l | ||
| 2043 | t k} is another way to delete from the buffer all files except those | ||
| 2044 | currently locked. | ||
| 2045 | |||
| 2046 | @node Remote Repositories | ||
| 2047 | @section Remote Repositories | ||
| 2048 | @cindex remote repositories (CVS) | ||
| 2049 | |||
| 2050 | A common way of using CVS is to set up a central CVS repository on | ||
| 2051 | some Internet host, then have each developer check out a personal | ||
| 2052 | working copy of the files on his local machine. Committing changes to | ||
| 2053 | the repository, and picking up changes from other users into one's own | ||
| 2054 | working area, then works by direct interactions with the CVS server. | ||
| 2055 | |||
| 2056 | One difficulty is that access to the CVS server is often slow, and | ||
| 2057 | that developers might need to work off-line as well. VC is designed | ||
| 2058 | to reduce the amount of network interaction necessary. | ||
| 2059 | |||
| 2060 | @menu | ||
| 2061 | * Version Backups:: Keeping local copies of repository versions. | ||
| 2062 | * Local Version Control:: Using another version system for local editing. | ||
| 2063 | @end menu | ||
| 2064 | |||
| 2065 | @node Version Backups | ||
| 2066 | @subsection Version Backups | ||
| 2067 | @cindex version backups | ||
| 2068 | |||
| 2069 | @cindex automatic version backups | ||
| 2070 | When VC sees that the CVS repository for a file is on a remote | ||
| 2071 | machine, it automatically makes local backups of unmodified versions | ||
| 2072 | of the file---@dfn{automatic version backups}. This means that you | ||
| 2073 | can compare the file to the repository version (@kbd{C-x v =}), or | ||
| 2074 | revert to that version (@kbd{C-x v u}), without any network | ||
| 2075 | interactions. | ||
| 2076 | |||
| 2077 | The local copy of the unmodified file is called a @dfn{version | ||
| 2078 | backup} to indicate that it corresponds exactly to a version that is | ||
| 2079 | stored in the repository. Note that version backups are not the same | ||
| 2080 | as ordinary Emacs backup files (@pxref{Backup,,,emacs, the Emacs | ||
| 2081 | Manual}). But they follow a similar naming convention. | ||
| 2082 | |||
| 2083 | For a file that comes from a remote CVS repository, VC makes a | ||
| 2084 | version backup whenever you save the first changes to the file, and | ||
| 2085 | removes it after you have committed your modified version to the | ||
| 2086 | repository. You can disable the making of automatic version backups by | ||
| 2087 | setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | ||
| 2088 | |||
| 2089 | @cindex manual version backups | ||
| 2090 | The name of the automatic version backup for version @var{version} | ||
| 2091 | of file @var{file} is @code{@var{file}.~@var{version}.~}. This is | ||
| 2092 | almost the same as the name used by @kbd{C-x v ~} (@pxref{Old | ||
| 2093 | Versions,,,emacs, the Emacs Manual}), the only difference being | ||
| 2094 | the additional dot (@samp{.}) after the version number. This | ||
| 2095 | similarity is intentional, because both kinds of files store the same | ||
| 2096 | kind of information. The file made by @kbd{C-x v ~} acts as a | ||
| 2097 | @dfn{manual version backup}. | ||
| 2098 | |||
| 2099 | All the VC commands that operate on old versions of a file can use | ||
| 2100 | both kinds of version backups. For instance, @kbd{C-x v ~} uses | ||
| 2101 | either an automatic or a manual version backup, if possible, to get | ||
| 2102 | the contents of the version you request. Likewise, @kbd{C-x v =} and | ||
| 2103 | @kbd{C-x v u} use either an automatic or a manual version backup, if | ||
| 2104 | one of them exists, to get the contents of a version to compare or | ||
| 2105 | revert to. If you changed a file outside of Emacs, so that no | ||
| 2106 | automatic version backup was created for the previous text, you can | ||
| 2107 | create a manual backup of that version using @kbd{C-x v ~}, and thus | ||
| 2108 | obtain the benefit of the local copy for Emacs commands. | ||
| 2109 | |||
| 2110 | The only difference in Emacs's handling of manual and automatic | ||
| 2111 | version backups, once they exist, is that Emacs deletes automatic | ||
| 2112 | version backups when you commit to the repository. By contrast, | ||
| 2113 | manual version backups remain until you delete them. | ||
| 2114 | |||
| 2115 | @node Local Version Control | ||
| 2116 | @subsection Local Version Control | ||
| 2117 | @cindex local version control | ||
| 2118 | @cindex local back end (version control) | ||
| 2119 | |||
| 2120 | When you make many changes to a file that comes from a remote | ||
| 2121 | repository, it can be convenient to have version control on your local | ||
| 2122 | machine as well. You can then record intermediate versions, revert to | ||
| 2123 | a previous state, etc., before you actually commit your changes to the | ||
| 2124 | remote server. | ||
| 2125 | |||
| 2126 | VC lets you do this by putting a file under a second, local version | ||
| 2127 | control system, so that the file is effectively registered in two | ||
| 2128 | systems at the same time. For the description here, we will assume | ||
| 2129 | that the remote system is CVS, and you use RCS locally, although the | ||
| 2130 | mechanism works with any combination of version control systems | ||
| 2131 | (@dfn{back ends}). | ||
| 2132 | |||
| 2133 | To make it work with other back ends, you must make sure that the | ||
| 2134 | ``more local'' back end comes before the ``more remote'' back end in | ||
| 2135 | the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By | ||
| 2136 | default, this variable is set up so that you can use remote CVS and | ||
| 2137 | local RCS as described here. | ||
| 2138 | |||
| 2139 | To start using local RCS for a file that comes from a remote CVS | ||
| 2140 | server, you must @emph{register the file in RCS}, by typing @kbd{C-u | ||
| 2141 | C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a | ||
| 2142 | prefix argument, and specify RCS as the back end.) | ||
| 2143 | |||
| 2144 | You can do this at any time; it does not matter whether you have | ||
| 2145 | already modified the file with respect to the version in the CVS | ||
| 2146 | repository. If possible, VC tries to make the RCS master start with | ||
| 2147 | the unmodified repository version, then checks in any local changes | ||
| 2148 | as a new version. This works if you have not made any changes yet, or | ||
| 2149 | if the unmodified repository version exists locally as a version | ||
| 2150 | backup (@pxref{Version Backups}). If the unmodified version is not | ||
| 2151 | available locally, the RCS master starts with the modified version; | ||
| 2152 | the only drawback to this is that you cannot compare your changes | ||
| 2153 | locally to what is stored in the repository. | ||
| 2154 | |||
| 2155 | The version number of the RCS master is derived from the current CVS | ||
| 2156 | version, starting a branch from it. For example, if the current CVS | ||
| 2157 | version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | ||
| 2158 | the RCS master will be identical to version 1.23 under CVS; your first | ||
| 2159 | changes are checked in as 1.23.1.1. (If the unmodified file is not | ||
| 2160 | available locally, VC will check in the modified file twice, both as | ||
| 2161 | 1.23 and 1.23.1.1, to make the revision numbers consistent.) | ||
| 2162 | |||
| 2163 | If you do not use locking under CVS (the default), locking is also | ||
| 2164 | disabled for RCS, so that editing under RCS works exactly as under | ||
| 2165 | CVS. | ||
| 2166 | |||
| 2167 | When you are done with local editing, you can commit the final version | ||
| 2168 | back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 2169 | This initializes the log entry buffer (@pxref{Log Buffer,,,emacs, the | ||
| 2170 | Emacs Manual}) to contain all the log entries you have recorded in the | ||
| 2171 | RCS master; you can edit them as you wish, and then commit in CVS by | ||
| 2172 | typing @kbd{C-c C-c}. If the commit is successful, VC removes the RCS | ||
| 2173 | master, so that the file is once again registered under CVS only. | ||
| 2174 | (The RCS master is not actually deleted, just renamed by appending | ||
| 2175 | @samp{~} to the name, so that you can refer to it later if you wish.) | ||
| 2176 | |||
| 2177 | While using local RCS, you can pick up recent changes from the CVS | ||
| 2178 | repository into your local file, or commit some of your changes back | ||
| 2179 | to CVS, without terminating local RCS version control. To do this, | ||
| 2180 | switch to the CVS back end temporarily, with the @kbd{C-x v b} command: | ||
| 2181 | |||
| 2182 | @table @kbd | ||
| 2183 | @item C-x v b | ||
| 2184 | Switch to another back end that the current file is registered | ||
| 2185 | under (@code{vc-switch-backend}). | ||
| 2186 | |||
| 2187 | @item C-u C-x v b @var{backend} @key{RET} | ||
| 2188 | Switch to @var{backend} for the current file. | ||
| 2189 | @end table | ||
| 2190 | |||
| 2191 | @kindex C-x v b | ||
| 2192 | @findex vc-switch-backend | ||
| 2193 | @kbd{C-x v b} does not change the buffer contents, or any files; it | ||
| 2194 | only changes VC's perspective on how to handle the file. Any | ||
| 2195 | subsequent VC commands for that file will operate on the back end that | ||
| 2196 | is currently selected. | ||
| 2197 | |||
| 2198 | If the current file is registered in more than one back end, typing | ||
| 2199 | @kbd{C-x v b} ``cycles'' through all of these back ends. With a | ||
| 2200 | prefix argument, it asks for the back end to use in the minibuffer. | ||
| 2201 | |||
| 2202 | Thus, if you are using local RCS, and you want to pick up some recent | ||
| 2203 | changes in the file from remote CVS, first visit the file, then type | ||
| 2204 | @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m | ||
| 2205 | @key{RET}} to merge the news (@pxref{Merging,,,emacs, the Emacs | ||
| 2206 | Manual}). You can then switch back to RCS by typing @kbd{C-x v b} | ||
| 2207 | again, and continue to edit locally. | ||
| 2208 | |||
| 2209 | But if you do this, the revision numbers in the RCS master no longer | ||
| 2210 | correspond to those of CVS. Technically, this is not a problem, but | ||
| 2211 | it can become difficult to keep track of what is in the CVS repository | ||
| 2212 | and what is not. So we suggest that you return from time to time to | ||
| 2213 | CVS-only operation, by committing your local changes back to the | ||
| 2214 | repository using @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 2215 | |||
| 2216 | @node Snapshots | ||
| 2217 | @section Snapshots | ||
| 2218 | @cindex snapshots and version control | ||
| 2219 | |||
| 2220 | A @dfn{snapshot} is a named set of file versions (one for each | ||
| 2221 | registered file) that you can treat as a unit. One important kind of | ||
| 2222 | snapshot is a @dfn{release}, a (theoretically) stable version of the | ||
| 2223 | system that is ready for distribution to users. | ||
| 2224 | |||
| 2225 | @menu | ||
| 2226 | * Making Snapshots:: The snapshot facilities. | ||
| 2227 | * Snapshot Caveats:: Things to be careful of when using snapshots. | ||
| 2228 | @end menu | ||
| 2229 | |||
| 2230 | @node Making Snapshots | ||
| 2231 | @subsection Making and Using Snapshots | ||
| 2232 | |||
| 2233 | There are two basic commands for snapshots; one makes a | ||
| 2234 | snapshot with a given name, the other retrieves a named snapshot. | ||
| 2235 | |||
| 2236 | @table @code | ||
| 2237 | @kindex C-x v s | ||
| 2238 | @findex vc-create-snapshot | ||
| 2239 | @item C-x v s @var{name} @key{RET} | ||
| 2240 | Define the last saved versions of every registered file in or under the | ||
| 2241 | current directory as a snapshot named @var{name} | ||
| 2242 | (@code{vc-create-snapshot}). | ||
| 2243 | |||
| 2244 | @kindex C-x v r | ||
| 2245 | @findex vc-retrieve-snapshot | ||
| 2246 | @item C-x v r @var{name} @key{RET} | ||
| 2247 | For all registered files at or below the current directory level, select | ||
| 2248 | whatever versions correspond to the snapshot @var{name} | ||
| 2249 | (@code{vc-retrieve-snapshot}). | ||
| 2250 | |||
| 2251 | This command reports an error if any files are locked at or below the | ||
| 2252 | current directory, without changing anything; this is to avoid | ||
| 2253 | overwriting work in progress. | ||
| 2254 | @end table | ||
| 2255 | |||
| 2256 | A snapshot uses a very small amount of resources---just enough to record | ||
| 2257 | the list of file names and which version belongs to the snapshot. Thus, | ||
| 2258 | you need not hesitate to create snapshots whenever they are useful. | ||
| 2259 | |||
| 2260 | You can give a snapshot name as an argument to @kbd{C-x v =} or | ||
| 2261 | @kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}). | ||
| 2262 | Thus, you can use it to compare a snapshot against the current files, | ||
| 2263 | or two snapshots against each other, or a snapshot against a named | ||
| 2264 | version. | ||
| 2265 | |||
| 2266 | @node Snapshot Caveats | ||
| 2267 | @subsection Snapshot Caveats | ||
| 2268 | |||
| 2269 | @cindex named configurations (RCS) | ||
| 2270 | VC's snapshot facilities are modeled on RCS's named-configuration | ||
| 2271 | support. They use RCS's native facilities for this, so | ||
| 2272 | snapshots made using RCS through VC are visible even when you bypass VC. | ||
| 2273 | |||
| 2274 | With CVS, Meta-CVS, and Subversion, VC also uses the native | ||
| 2275 | mechanism provided by that back end to make snapshots and retrieve them | ||
| 2276 | (@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion). | ||
| 2277 | |||
| 2278 | @c worded verbosely to avoid overfull hbox. | ||
| 2279 | For SCCS, VC implements snapshots itself. The files it uses contain | ||
| 2280 | name/file/version-number triples. These snapshots are visible only | ||
| 2281 | through VC. | ||
| 2282 | |||
| 2283 | There is no support for VC snapshots using GNU Arch yet. | ||
| 2284 | |||
| 2285 | A snapshot is a set of checked-in versions. So make sure that all the | ||
| 2286 | files are checked in and not locked when you make a snapshot. | ||
| 2287 | |||
| 2288 | File renaming and deletion can create some difficulties with snapshots. | ||
| 2289 | This is not a VC-specific problem, but a general design issue in version | ||
| 2290 | control systems that no one has solved very well yet. | ||
| 2291 | |||
| 2292 | If you rename a registered file, you need to rename its master along | ||
| 2293 | with it (the command @code{vc-rename-file} does this automatically). If | ||
| 2294 | you are using SCCS, you must also update the records of the snapshot, to | ||
| 2295 | mention the file by its new name (@code{vc-rename-file} does this, | ||
| 2296 | too). An old snapshot that refers to a master file that no longer | ||
| 2297 | exists under the recorded name is invalid; VC can no longer retrieve | ||
| 2298 | it. It would be beyond the scope of this manual to explain enough about | ||
| 2299 | RCS and SCCS to explain how to update the snapshots by hand. | ||
| 2300 | |||
| 2301 | Using @code{vc-rename-file} makes the snapshot remain valid for | ||
| 2302 | retrieval, but it does not solve all problems. For example, some of the | ||
| 2303 | files in your program probably refer to others by name. At the very | ||
| 2304 | least, the makefile probably mentions the file that you renamed. If you | ||
| 2305 | retrieve an old snapshot, the renamed file is retrieved under its new | ||
| 2306 | name, which is not the name that the makefile expects. So the program | ||
| 2307 | won't really work as retrieved. | ||
| 2308 | |||
| 2309 | @node Miscellaneous VC | ||
| 2310 | @section Miscellaneous Commands and Features of VC | ||
| 2311 | |||
| 2312 | This section explains the less-frequently-used features of VC. | ||
| 2313 | |||
| 2314 | @menu | ||
| 2315 | * Change Logs and VC:: Generating a change log file from log entries. | ||
| 2316 | * Renaming and VC:: A command to rename both the source and master | ||
| 2317 | file correctly. | ||
| 2318 | * Version Headers:: Inserting version control headers into working files. | ||
| 2319 | @end menu | ||
| 2320 | |||
| 2321 | @node Change Logs and VC | ||
| 2322 | @subsection Change Logs and VC | ||
| 2323 | |||
| 2324 | If you use RCS or CVS for a program and also maintain a change log | ||
| 2325 | file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you | ||
| 2326 | can generate change log entries automatically from the version control | ||
| 2327 | log entries: | ||
| 2328 | |||
| 2329 | @table @kbd | ||
| 2330 | @item C-x v a | ||
| 2331 | @kindex C-x v a | ||
| 2332 | @findex vc-update-change-log | ||
| 2333 | Visit the current directory's change log file and, for registered files | ||
| 2334 | in that directory, create new entries for versions checked in since the | ||
| 2335 | most recent entry in the change log file. | ||
| 2336 | (@code{vc-update-change-log}). | ||
| 2337 | |||
| 2338 | This command works with RCS or CVS only, not with any of the other | ||
| 2339 | back ends. | ||
| 2340 | |||
| 2341 | @item C-u C-x v a | ||
| 2342 | As above, but only find entries for the current buffer's file. | ||
| 2343 | |||
| 2344 | @item M-1 C-x v a | ||
| 2345 | As above, but find entries for all the currently visited files that are | ||
| 2346 | maintained with version control. This works only with RCS, and it puts | ||
| 2347 | all entries in the log for the default directory, which may not be | ||
| 2348 | appropriate. | ||
| 2349 | @end table | ||
| 2350 | |||
| 2351 | For example, suppose the first line of @file{ChangeLog} is dated | ||
| 2352 | 1999-04-10, and that the only check-in since then was by Nathaniel | ||
| 2353 | Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log | ||
| 2354 | messages that start with `#'.}. Then @kbd{C-x v a} visits | ||
| 2355 | @file{ChangeLog} and inserts text like this: | ||
| 2356 | |||
| 2357 | @iftex | ||
| 2358 | @medbreak | ||
| 2359 | @end iftex | ||
| 2360 | @smallexample | ||
| 2361 | @group | ||
| 2362 | 1999-05-22 Nathaniel Bowditch <nat@@apn.org> | ||
| 2363 | |||
| 2364 | * rcs2log: Ignore log messages that start with `#'. | ||
| 2365 | @end group | ||
| 2366 | @end smallexample | ||
| 2367 | @iftex | ||
| 2368 | @medbreak | ||
| 2369 | @end iftex | ||
| 2370 | |||
| 2371 | @noindent | ||
| 2372 | You can then edit the new change log entry further as you wish. | ||
| 2373 | |||
| 2374 | Some of the new change log entries may duplicate what's already in | ||
| 2375 | ChangeLog. You will have to remove these duplicates by hand. | ||
| 2376 | |||
| 2377 | Normally, the log entry for file @file{foo} is displayed as @samp{* | ||
| 2378 | foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | ||
| 2379 | if the text of the log entry starts with @w{@samp{(@var{functionname}): | ||
| 2380 | }}. For example, if the log entry for @file{vc.el} is | ||
| 2381 | @samp{(vc-do-command): Check call-process status.}, then the text in | ||
| 2382 | @file{ChangeLog} looks like this: | ||
| 2383 | |||
| 2384 | @iftex | ||
| 2385 | @medbreak | ||
| 2386 | @end iftex | ||
| 2387 | @smallexample | ||
| 2388 | @group | ||
| 2389 | 1999-05-06 Nathaniel Bowditch <nat@@apn.org> | ||
| 2390 | |||
| 2391 | * vc.el (vc-do-command): Check call-process status. | ||
| 2392 | @end group | ||
| 2393 | @end smallexample | ||
| 2394 | @iftex | ||
| 2395 | @medbreak | ||
| 2396 | @end iftex | ||
| 2397 | |||
| 2398 | When @kbd{C-x v a} adds several change log entries at once, it groups | ||
| 2399 | related log entries together if they all are checked in by the same | ||
| 2400 | author at nearly the same time. If the log entries for several such | ||
| 2401 | files all have the same text, it coalesces them into a single entry. | ||
| 2402 | For example, suppose the most recent check-ins have the following log | ||
| 2403 | entries: | ||
| 2404 | |||
| 2405 | @flushleft | ||
| 2406 | @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} | ||
| 2407 | @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} | ||
| 2408 | @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} | ||
| 2409 | @end flushleft | ||
| 2410 | |||
| 2411 | @noindent | ||
| 2412 | They appear like this in @file{ChangeLog}: | ||
| 2413 | |||
| 2414 | @iftex | ||
| 2415 | @medbreak | ||
| 2416 | @end iftex | ||
| 2417 | @smallexample | ||
| 2418 | @group | ||
| 2419 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 2420 | |||
| 2421 | * vc.texinfo: Fix expansion typos. | ||
| 2422 | |||
| 2423 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 2424 | @end group | ||
| 2425 | @end smallexample | ||
| 2426 | @iftex | ||
| 2427 | @medbreak | ||
| 2428 | @end iftex | ||
| 2429 | |||
| 2430 | Normally, @kbd{C-x v a} separates log entries by a blank line, but you | ||
| 2431 | can mark several related log entries to be clumped together (without an | ||
| 2432 | intervening blank line) by starting the text of each related log entry | ||
| 2433 | with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label | ||
| 2434 | itself is not copied to @file{ChangeLog}. For example, suppose the log | ||
| 2435 | entries are: | ||
| 2436 | |||
| 2437 | @flushleft | ||
| 2438 | @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} | ||
| 2439 | @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 2440 | @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 2441 | @end flushleft | ||
| 2442 | |||
| 2443 | @noindent | ||
| 2444 | Then the text in @file{ChangeLog} looks like this: | ||
| 2445 | |||
| 2446 | @iftex | ||
| 2447 | @medbreak | ||
| 2448 | @end iftex | ||
| 2449 | @smallexample | ||
| 2450 | @group | ||
| 2451 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 2452 | |||
| 2453 | * vc.texinfo: Fix expansion typos. | ||
| 2454 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 2455 | @end group | ||
| 2456 | @end smallexample | ||
| 2457 | @iftex | ||
| 2458 | @medbreak | ||
| 2459 | @end iftex | ||
| 2460 | |||
| 2461 | A log entry whose text begins with @samp{#} is not copied to | ||
| 2462 | @file{ChangeLog}. For example, if you merely fix some misspellings in | ||
| 2463 | comments, you can log the change with an entry beginning with @samp{#} | ||
| 2464 | to avoid putting such trivia into @file{ChangeLog}. | ||
| 2465 | |||
| 2466 | @node Renaming and VC | ||
| 2467 | @subsection Renaming VC Work Files and Master Files | ||
| 2468 | |||
| 2469 | @findex vc-rename-file | ||
| 2470 | When you rename a registered file, you must also rename its master | ||
| 2471 | file correspondingly to get proper results. Use @code{vc-rename-file} | ||
| 2472 | to rename the source file as you specify, and rename its master file | ||
| 2473 | accordingly. It also updates any snapshots (@pxref{Snapshots}) that | ||
| 2474 | mention the file, so that they use the new name; despite this, the | ||
| 2475 | snapshot thus modified may not completely work (@pxref{Snapshot | ||
| 2476 | Caveats}). | ||
| 2477 | |||
| 2478 | Some back ends do not provide an explicit rename operation to their | ||
| 2479 | repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} | ||
| 2480 | on the original and renamed buffers and provide the necessary edit | ||
| 2481 | log. | ||
| 2482 | |||
| 2483 | You cannot use @code{vc-rename-file} on a file that is locked by | ||
| 2484 | someone else. | ||
| 2485 | |||
| 2486 | @node Version Headers | ||
| 2487 | @subsection Inserting Version Control Headers | ||
| 2488 | |||
| 2489 | Sometimes it is convenient to put version identification strings | ||
| 2490 | directly into working files. Certain special strings called | ||
| 2491 | @dfn{version headers} are replaced in each successive version by the | ||
| 2492 | number of that version, the name of the user who created it, and other | ||
| 2493 | relevant information. All of the back ends that VC supports have such | ||
| 2494 | a mechanism, except GNU Arch. | ||
| 2495 | |||
| 2496 | VC does not normally use the information contained in these headers. | ||
| 2497 | The exception is RCS---with RCS, version headers are sometimes more | ||
| 2498 | reliable than the master file to determine which version of the file | ||
| 2499 | you are editing. Note that in a multi-branch environment, version | ||
| 2500 | headers are necessary to make VC behave correctly (@pxref{Multi-User | ||
| 2501 | Branching,,,emacs, the Emacs Manual}). | ||
| 2502 | |||
| 2503 | Searching for RCS version headers is controlled by the variable | ||
| 2504 | @code{vc-consult-headers}. If it is non-@code{nil} (the default), | ||
| 2505 | Emacs searches for headers to determine the version number you are | ||
| 2506 | editing. Setting it to @code{nil} disables this feature. | ||
| 2507 | |||
| 2508 | Note that although CVS uses the same kind of version headers as RCS | ||
| 2509 | does, VC never searches for these headers if you are using CVS, | ||
| 2510 | regardless of the above setting. | ||
| 2511 | |||
| 2512 | @kindex C-x v h | ||
| 2513 | @findex vc-insert-headers | ||
| 2514 | You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to | ||
| 2515 | insert a suitable header string. | ||
| 2516 | |||
| 2517 | @table @kbd | ||
| 2518 | @item C-x v h | ||
| 2519 | Insert headers in a file for use with your version-control system. | ||
| 2520 | @end table | ||
| 2521 | |||
| 2522 | @vindex vc-@var{backend}-header | ||
| 2523 | The default header string is @samp{@w{$}Id$} for RCS and | ||
| 2524 | @samp{@w{%}W%} for SCCS. You can specify other headers to insert by | ||
| 2525 | setting the variables @code{vc-@var{backend}-header} where | ||
| 2526 | @var{backend} is @code{rcs} or @code{sccs}. | ||
| 2527 | |||
| 2528 | Instead of a single string, you can specify a list of strings; then | ||
| 2529 | each string in the list is inserted as a separate header on a line of | ||
| 2530 | its own. | ||
| 2531 | |||
| 2532 | It may be necessary to use apparently-superfluous backslashes when | ||
| 2533 | writing the strings that you put in this variable. For instance, you | ||
| 2534 | might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra | ||
| 2535 | backslash prevents the string constant from being interpreted as a | ||
| 2536 | header, if the Emacs Lisp file containing it is maintained with | ||
| 2537 | version control. | ||
| 2538 | |||
| 2539 | @vindex vc-comment-alist | ||
| 2540 | Each header is inserted surrounded by tabs, inside comment delimiters, | ||
| 2541 | on a new line at point. Normally the ordinary comment | ||
| 2542 | start and comment end strings of the current mode are used, but for | ||
| 2543 | certain modes, there are special comment delimiters for this purpose; | ||
| 2544 | the variable @code{vc-comment-alist} specifies them. Each element of | ||
| 2545 | this list has the form @code{(@var{mode} @var{starter} @var{ender})}. | ||
| 2546 | |||
| 2547 | @vindex vc-static-header-alist | ||
| 2548 | The variable @code{vc-static-header-alist} specifies further strings | ||
| 2549 | to add based on the name of the buffer. Its value should be a list of | ||
| 2550 | elements of the form @code{(@var{regexp} . @var{format})}. Whenever | ||
| 2551 | @var{regexp} matches the buffer name, @var{format} is inserted as part | ||
| 2552 | of the header. A header line is inserted for each element that matches | ||
| 2553 | the buffer name, and for each string specified by | ||
| 2554 | @code{vc-@var{backend}-header}. The header line is made by processing the | ||
| 2555 | string from @code{vc-@var{backend}-header} with the format taken from the | ||
| 2556 | element. The default value for @code{vc-static-header-alist} is as follows: | ||
| 2557 | |||
| 2558 | @example | ||
| 2559 | @group | ||
| 2560 | (("\\.c$" . | ||
| 2561 | "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ | ||
| 2562 | #endif /* lint */\n")) | ||
| 2563 | @end group | ||
| 2564 | @end example | ||
| 2565 | |||
| 2566 | @noindent | ||
| 2567 | It specifies insertion of text of this form: | ||
| 2568 | |||
| 2569 | @example | ||
| 2570 | @group | ||
| 2571 | |||
| 2572 | #ifndef lint | ||
| 2573 | static char vcid[] = "@var{string}"; | ||
| 2574 | #endif /* lint */ | ||
| 2575 | @end group | ||
| 2576 | @end example | ||
| 2577 | |||
| 2578 | @noindent | ||
| 2579 | Note that the text above starts with a blank line. | ||
| 2580 | |||
| 2581 | If you use more than one version header in a file, put them close | ||
| 2582 | together in the file. The mechanism in @code{revert-buffer} that | ||
| 2583 | preserves markers may not handle markers positioned between two version | ||
| 2584 | headers. | ||
| 2585 | |||
| 2586 | @node Customizing VC | ||
| 2587 | @section Customizing VC | ||
| 2588 | |||
| 2589 | @vindex vc-handled-backends | ||
| 2590 | The variable @code{vc-handled-backends} determines which version | ||
| 2591 | control systems VC should handle. The default value is @code{(RCS CVS | ||
| 2592 | SVN SCCS Arch MCVS)}, so it contains all six version systems that are | ||
| 2593 | currently supported. If you want VC to ignore one or more of these | ||
| 2594 | systems, exclude its name from the list. To disable VC entirely, set | ||
| 2595 | this variable to @code{nil}. | ||
| 2596 | |||
| 2597 | The order of systems in the list is significant: when you visit a file | ||
| 2598 | registered in more than one system (@pxref{Local Version Control}), VC | ||
| 2599 | uses the system that comes first in @code{vc-handled-backends} by | ||
| 2600 | default. The order is also significant when you register a file for | ||
| 2601 | the first time, @pxref{Registering,,,emacs, the Emacs Manual} for | ||
| 2602 | details. | ||
| 2603 | |||
| 2604 | @menu | ||
| 2605 | * General VC Options:: Options that apply to multiple back ends. | ||
| 2606 | * RCS and SCCS:: Options for RCS and SCCS. | ||
| 2607 | * CVS Options:: Options for CVS. | ||
| 2608 | @end menu | ||
| 2609 | |||
| 2610 | @node General VC Options | ||
| 2611 | @subsection General Options | ||
| 2612 | |||
| 2613 | @vindex vc-make-backup-files | ||
| 2614 | Emacs normally does not save backup files for source files that are | ||
| 2615 | maintained with version control. If you want to make backup files even | ||
| 2616 | for files that use version control, set the variable | ||
| 2617 | @code{vc-make-backup-files} to a non-@code{nil} value. | ||
| 2618 | |||
| 2619 | @vindex vc-keep-workfiles | ||
| 2620 | Normally the work file exists all the time, whether it is locked or | ||
| 2621 | not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking | ||
| 2622 | in a new version with @kbd{C-x v v} deletes the work file; but any | ||
| 2623 | attempt to visit the file with Emacs creates it again. (With CVS, work | ||
| 2624 | files are always kept.) | ||
| 2625 | |||
| 2626 | @vindex vc-follow-symlinks | ||
| 2627 | Editing a version-controlled file through a symbolic link can be | ||
| 2628 | dangerous. It bypasses the version control system---you can edit the | ||
| 2629 | file without locking it, and fail to check your changes in. Also, | ||
| 2630 | your changes might overwrite those of another user. To protect against | ||
| 2631 | this, VC checks each symbolic link that you visit, to see if it points | ||
| 2632 | to a file under version control. | ||
| 2633 | |||
| 2634 | The variable @code{vc-follow-symlinks} controls what to do when a | ||
| 2635 | symbolic link points to a version-controlled file. If it is @code{nil}, | ||
| 2636 | VC only displays a warning message. If it is @code{t}, VC automatically | ||
| 2637 | follows the link, and visits the real file instead, telling you about | ||
| 2638 | this in the echo area. If the value is @code{ask} (the default), VC | ||
| 2639 | asks you each time whether to follow the link. | ||
| 2640 | |||
| 2641 | @vindex vc-suppress-confirm | ||
| 2642 | If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} | ||
| 2643 | and @kbd{C-x v i} can save the current buffer without asking, and | ||
| 2644 | @kbd{C-x v u} also operates without asking for confirmation. (This | ||
| 2645 | variable does not affect @kbd{C-x v c}; that operation is so drastic | ||
| 2646 | that it should always ask for confirmation.) | ||
| 2647 | |||
| 2648 | @vindex vc-command-messages | ||
| 2649 | VC mode does much of its work by running the shell commands for RCS, | ||
| 2650 | CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC | ||
| 2651 | displays messages to indicate which shell commands it runs, and | ||
| 2652 | additional messages when the commands finish. | ||
| 2653 | |||
| 2654 | @vindex vc-path | ||
| 2655 | You can specify additional directories to search for version control | ||
| 2656 | programs by setting the variable @code{vc-path}. These directories | ||
| 2657 | are searched before the usual search path. It is rarely necessary to | ||
| 2658 | set this variable, because VC normally finds the proper files | ||
| 2659 | automatically. | ||
| 2660 | |||
| 2661 | @node RCS and SCCS | ||
| 2662 | @subsection Options for RCS and SCCS | ||
| 2663 | |||
| 2664 | @cindex non-strict locking (RCS) | ||
| 2665 | @cindex locking, non-strict (RCS) | ||
| 2666 | By default, RCS uses locking to coordinate the activities of several | ||
| 2667 | users, but there is a mode called @dfn{non-strict locking} in which | ||
| 2668 | you can check-in changes without locking the file first. Use | ||
| 2669 | @samp{rcs -U} to switch to non-strict locking for a particular file, | ||
| 2670 | see the @code{rcs} manual page for details. | ||
| 2671 | |||
| 2672 | When deducing the version control state of an RCS file, VC first | ||
| 2673 | looks for an RCS version header string in the file (@pxref{Version | ||
| 2674 | Headers}). If there is no header string, VC normally looks at the | ||
| 2675 | file permissions of the work file; this is fast. But there might be | ||
| 2676 | situations when the file permissions cannot be trusted. In this case | ||
| 2677 | the master file has to be consulted, which is rather expensive. Also | ||
| 2678 | the master file can only tell you @emph{if} there's any lock on the | ||
| 2679 | file, but not whether your work file really contains that locked | ||
| 2680 | version. | ||
| 2681 | |||
| 2682 | @vindex vc-consult-headers | ||
| 2683 | You can tell VC not to use version headers to determine the file | ||
| 2684 | status by setting @code{vc-consult-headers} to @code{nil}. VC then | ||
| 2685 | always uses the file permissions (if it is supposed to trust them), or | ||
| 2686 | else checks the master file. | ||
| 2687 | |||
| 2688 | @vindex vc-mistrust-permissions | ||
| 2689 | You can specify the criterion for whether to trust the file | ||
| 2690 | permissions by setting the variable @code{vc-mistrust-permissions}. | ||
| 2691 | Its value can be @code{t} (always mistrust the file permissions and | ||
| 2692 | check the master file), @code{nil} (always trust the file | ||
| 2693 | permissions), or a function of one argument which makes the decision. | ||
| 2694 | The argument is the directory name of the @file{RCS} subdirectory. A | ||
| 2695 | non-@code{nil} value from the function says to mistrust the file | ||
| 2696 | permissions. If you find that the file permissions of work files are | ||
| 2697 | changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. | ||
| 2698 | Then VC always checks the master file to determine the file's status. | ||
| 2699 | |||
| 2700 | VC determines the version control state of files under SCCS much as | ||
| 2701 | with RCS. It does not consider SCCS version headers, though. Thus, | ||
| 2702 | the variable @code{vc-mistrust-permissions} affects SCCS use, but | ||
| 2703 | @code{vc-consult-headers} does not. | ||
| 2704 | |||
| 2705 | @node CVS Options | ||
| 2706 | @subsection Options specific for CVS | ||
| 2707 | |||
| 2708 | @cindex locking (CVS) | ||
| 2709 | By default, CVS does not use locking to coordinate the activities of | ||
| 2710 | several users; anyone can change a work file at any time. However, | ||
| 2711 | there are ways to restrict this, resulting in behavior that resembles | ||
| 2712 | locking. | ||
| 2713 | |||
| 2714 | @cindex CVSREAD environment variable (CVS) | ||
| 2715 | For one thing, you can set the @env{CVSREAD} environment variable | ||
| 2716 | (the value you use makes no difference). If this variable is defined, | ||
| 2717 | CVS makes your work files read-only by default. In Emacs, you must | ||
| 2718 | type @kbd{C-x v v} to make the file writable, so that editing works | ||
| 2719 | in fact similar as if locking was used. Note however, that no actual | ||
| 2720 | locking is performed, so several users can make their files writable | ||
| 2721 | at the same time. When setting @env{CVSREAD} for the first time, make | ||
| 2722 | sure to check out all your modules anew, so that the file protections | ||
| 2723 | are set correctly. | ||
| 2724 | |||
| 2725 | @cindex cvs watch feature | ||
| 2726 | @cindex watching files (CVS) | ||
| 2727 | Another way to achieve something similar to locking is to use the | ||
| 2728 | @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | ||
| 2729 | read-only by default, and you must also use @kbd{C-x v v} in Emacs to | ||
| 2730 | make it writable. VC calls @code{cvs edit} to make the file writable, | ||
| 2731 | and CVS takes care to notify other developers of the fact that you | ||
| 2732 | intend to change the file. See the CVS documentation for details on | ||
| 2733 | using the watch feature. | ||
| 2734 | |||
| 2735 | @vindex vc-stay-local | ||
| 2736 | @vindex vc-cvs-stay-local | ||
| 2737 | @cindex remote repositories (CVS) | ||
| 2738 | When a file's repository is on a remote machine, VC tries to keep | ||
| 2739 | network interactions to a minimum. This is controlled by the variable | ||
| 2740 | @code{vc-cvs-stay-local}. There is another variable, | ||
| 2741 | @code{vc-stay-local}, which enables the feature also for other back | ||
| 2742 | ends that support it, including CVS. In the following, we will talk | ||
| 2743 | only about @code{vc-cvs-stay-local}, but everything applies to | ||
| 2744 | @code{vc-stay-local} as well. | ||
| 2745 | |||
| 2746 | If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses | ||
| 2747 | only the entry in the local CVS subdirectory to determine the file's | ||
| 2748 | state (and possibly information returned by previous CVS commands). | ||
| 2749 | One consequence of this is that when you have modified a file, and | ||
| 2750 | somebody else has already checked in other changes to the file, you | ||
| 2751 | are not notified of it until you actually try to commit. (But you can | ||
| 2752 | try to pick up any recent changes from the repository first, using | ||
| 2753 | @kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}). | ||
| 2754 | |||
| 2755 | When @code{vc-cvs-stay-local} is @code{t}, VC also makes local | ||
| 2756 | version backups, so that simple diff and revert operations are | ||
| 2757 | completely local (@pxref{Version Backups}). | ||
| 2758 | |||
| 2759 | On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, | ||
| 2760 | then VC queries the remote repository @emph{before} it decides what to | ||
| 2761 | do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 2762 | repositories. It also does not make any version backups. | ||
| 2763 | |||
| 2764 | You can also set @code{vc-cvs-stay-local} to a regular expression | ||
| 2765 | that is matched against the repository host name; VC then stays local | ||
| 2766 | only for repositories from hosts that match the pattern. | ||
| 2767 | |||
| 2768 | @vindex vc-cvs-global-switches | ||
| 2769 | You can specify additional command line options to pass to all CVS | ||
| 2770 | operations in the variable @code{vc-cvs-global-switches}. These | ||
| 2771 | switches are inserted immediately after the @code{cvs} command, before | ||
| 2772 | the name of the operation to invoke. | ||
| 2773 | |||
| 2774 | |||
| 1892 | @node Fortran | 2775 | @node Fortran |
| 1893 | @chapter Fortran Mode | 2776 | @chapter Fortran Mode |
| 1894 | @cindex Fortran mode | 2777 | @cindex Fortran mode |
diff --git a/man/emacs.texi b/man/emacs.texi index 0dc04945e9f..c926961891f 100644 --- a/man/emacs.texi +++ b/man/emacs.texi | |||
| @@ -399,10 +399,6 @@ Version Control | |||
| 399 | * Old Versions:: Examining and comparing old versions. | 399 | * Old Versions:: Examining and comparing old versions. |
| 400 | * Secondary VC Commands:: The commands used a little less frequently. | 400 | * Secondary VC Commands:: The commands used a little less frequently. |
| 401 | * Branches:: Multiple lines of development. | 401 | * Branches:: Multiple lines of development. |
| 402 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 403 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 404 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 405 | * Customizing VC:: Variables that change VC's behavior. | ||
| 406 | 402 | ||
| 407 | Using Multiple Buffers | 403 | Using Multiple Buffers |
| 408 | 404 | ||
diff --git a/man/files.texi b/man/files.texi index 4847f0d1355..ab3fe7bb583 100644 --- a/man/files.texi +++ b/man/files.texi | |||
| @@ -517,7 +517,8 @@ value is @code{t}, so that Emacs does write backup files. | |||
| 517 | Control}), the variable @code{vc-make-backup-files} determines whether | 517 | Control}), the variable @code{vc-make-backup-files} determines whether |
| 518 | to make backup files. By default it is @code{nil}, since backup files | 518 | to make backup files. By default it is @code{nil}, since backup files |
| 519 | are redundant when you store all the previous versions in a version | 519 | are redundant when you store all the previous versions in a version |
| 520 | control system. @xref{General VC Options}. | 520 | control system. @xref{General VC Options,,,emacs-xtra, Specialized |
| 521 | Emacs Features}. | ||
| 521 | 522 | ||
| 522 | At your option, Emacs can keep either a single backup for each file, | 523 | At your option, Emacs can keep either a single backup for each file, |
| 523 | or make a series of numbered backup files for each file that you edit. | 524 | or make a series of numbered backup files for each file that you edit. |
| @@ -1200,7 +1201,7 @@ RCS or CVS, you can switch to CSSC. | |||
| 1200 | 1201 | ||
| 1201 | VC is enabled by default in Emacs. To disable it, set the | 1202 | VC is enabled by default in Emacs. To disable it, set the |
| 1202 | customizable variable @code{vc-handled-backends} to @code{nil} | 1203 | customizable variable @code{vc-handled-backends} to @code{nil} |
| 1203 | (@pxref{Customizing VC}). | 1204 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). |
| 1204 | 1205 | ||
| 1205 | @menu | 1206 | @menu |
| 1206 | * Introduction to VC:: How version control works in general. | 1207 | * Introduction to VC:: How version control works in general. |
| @@ -1209,10 +1210,6 @@ customizable variable @code{vc-handled-backends} to @code{nil} | |||
| 1209 | * Old Versions:: Examining and comparing old versions. | 1210 | * Old Versions:: Examining and comparing old versions. |
| 1210 | * Secondary VC Commands:: The commands used a little less frequently. | 1211 | * Secondary VC Commands:: The commands used a little less frequently. |
| 1211 | * Branches:: Multiple lines of development. | 1212 | * Branches:: Multiple lines of development. |
| 1212 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 1213 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 1214 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 1215 | * Customizing VC:: Variables that change VC's behavior. | ||
| 1216 | @end menu | 1213 | @end menu |
| 1217 | 1214 | ||
| 1218 | @node Introduction to VC | 1215 | @node Introduction to VC |
| @@ -1350,7 +1347,7 @@ permitted; check-in is still the way to record a new version. | |||
| 1350 | CVS normally allows each user to modify his own copy of the work file | 1347 | CVS normally allows each user to modify his own copy of the work file |
| 1351 | at any time, but requires merging with changes from other users at | 1348 | at any time, but requires merging with changes from other users at |
| 1352 | check-in time. However, CVS can also be set up to require locking. | 1349 | check-in time. However, CVS can also be set up to require locking. |
| 1353 | (@pxref{CVS Options}). | 1350 | (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). |
| 1354 | 1351 | ||
| 1355 | @node Types of Log File | 1352 | @node Types of Log File |
| 1356 | @subsubsection Types of Log File | 1353 | @subsubsection Types of Log File |
| @@ -1382,7 +1379,8 @@ for each change just once, then put it into both logs. You can write | |||
| 1382 | the entry in @file{ChangeLog}, then copy it to the log buffer when you | 1379 | the entry in @file{ChangeLog}, then copy it to the log buffer when you |
| 1383 | check in the change. Or you can write the entry in the log buffer | 1380 | check in the change. Or you can write the entry in the log buffer |
| 1384 | while checking in the change, and later use the @kbd{C-x v a} command | 1381 | while checking in the change, and later use the @kbd{C-x v a} command |
| 1385 | to copy it to @file{ChangeLog} (@pxref{Change Logs and VC}). | 1382 | to copy it to @file{ChangeLog} (@pxref{Change Logs and |
| 1383 | VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1386 | 1384 | ||
| 1387 | @node VC Mode Line | 1385 | @node VC Mode Line |
| 1388 | @subsection Version Control and the Mode Line | 1386 | @subsection Version Control and the Mode Line |
| @@ -1547,7 +1545,7 @@ the repository. | |||
| 1547 | Instead of the version number, you can also specify the name of a | 1545 | Instead of the version number, you can also specify the name of a |
| 1548 | version control system. This is useful when one file is being managed | 1546 | version control system. This is useful when one file is being managed |
| 1549 | with two version control systems at the same time (@pxref{Local | 1547 | with two version control systems at the same time (@pxref{Local |
| 1550 | Version Control}). | 1548 | Version Control,,,emacs-xtra, Specialized Emacs Features}). |
| 1551 | @end itemize | 1549 | @end itemize |
| 1552 | 1550 | ||
| 1553 | @node Log Buffer | 1551 | @node Log Buffer |
| @@ -1569,14 +1567,16 @@ control, you can generate the Log Edit text from the ChangeLog using | |||
| 1569 | entries for the file(s) concerned in the top entry in the ChangeLog | 1567 | entries for the file(s) concerned in the top entry in the ChangeLog |
| 1570 | and uses those paragraphs as the log text. This text is only inserted | 1568 | and uses those paragraphs as the log text. This text is only inserted |
| 1571 | if the top entry was made under your user name on the current date. | 1569 | if the top entry was made under your user name on the current date. |
| 1572 | @xref{Change Logs and VC}, for the opposite way of | 1570 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, |
| 1573 | working---generating ChangeLog entries from the revision control log. | 1571 | for the opposite way of working---generating ChangeLog entries from |
| 1572 | the revision control log. | ||
| 1574 | 1573 | ||
| 1575 | In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x log-edit-show-files}) | 1574 | In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x |
| 1576 | shows the list of files to be committed in case you need to check | 1575 | log-edit-show-files}) shows the list of files to be committed in case |
| 1577 | that. (This can be a list of more than one file if you use VC Dired | 1576 | you need to check that. (This can be a list of more than one file if |
| 1578 | mode or PCL-CVS. @xref{VC Dired Mode}, and @ref{Top, , About PCL-CVS, | 1577 | you use VC Dired mode or PCL-CVS. @xref{VC Dired Mode,,,emacs-xtra, |
| 1579 | pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.) | 1578 | Specialized Emacs Features}, and @ref{Top, , About PCL-CVS, pcl-cvs, |
| 1579 | PCL-CVS --- The Emacs Front-End to CVS}.) | ||
| 1580 | 1580 | ||
| 1581 | When you have finished editing the log message, type @kbd{C-c C-c} to | 1581 | When you have finished editing the log message, type @kbd{C-c C-c} to |
| 1582 | exit the buffer and commit the change. | 1582 | exit the buffer and commit the change. |
| @@ -1644,7 +1644,7 @@ Both forms display the output in a special buffer in another window. | |||
| 1644 | You can specify a checked-in version by its number; an empty input | 1644 | You can specify a checked-in version by its number; an empty input |
| 1645 | specifies the current contents of the work file (which may be different | 1645 | specifies the current contents of the work file (which may be different |
| 1646 | from all the checked-in versions). You can also specify a snapshot name | 1646 | from all the checked-in versions). You can also specify a snapshot name |
| 1647 | (@pxref{Snapshots}) instead of one or both version numbers. | 1647 | (@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features}) instead of one or both version numbers. |
| 1648 | 1648 | ||
| 1649 | If you supply a directory name instead of the name of a registered | 1649 | If you supply a directory name instead of the name of a registered |
| 1650 | file, this command compares the two specified versions of all registered | 1650 | file, this command compares the two specified versions of all registered |
| @@ -1733,8 +1733,6 @@ use once a day. | |||
| 1733 | * Registering:: Putting a file under version control. | 1733 | * Registering:: Putting a file under version control. |
| 1734 | * VC Status:: Viewing the VC status of files. | 1734 | * VC Status:: Viewing the VC status of files. |
| 1735 | * VC Undo:: Canceling changes before or after check-in. | 1735 | * VC Undo:: Canceling changes before or after check-in. |
| 1736 | * VC Dired Mode:: Listing files managed by version control. | ||
| 1737 | * VC Dired Commands:: Commands to use in a VC Dired buffer. | ||
| 1738 | @end menu | 1736 | @end menu |
| 1739 | 1737 | ||
| 1740 | @node Registering | 1738 | @node Registering |
| @@ -1753,14 +1751,15 @@ Register the visited file for version control. | |||
| 1753 | To register the file, Emacs must choose which version control system | 1751 | To register the file, Emacs must choose which version control system |
| 1754 | to use for it. If the file's directory already contains files | 1752 | to use for it. If the file's directory already contains files |
| 1755 | registered in a version control system, Emacs uses that system. If | 1753 | registered in a version control system, Emacs uses that system. If |
| 1756 | there is more than one system in use for a directory, Emacs uses the one | 1754 | there is more than one system in use for a directory, Emacs uses the |
| 1757 | that appears first in @code{vc-handled-backends} (@pxref{Customizing VC}). | 1755 | one that appears first in @code{vc-handled-backends} |
| 1758 | On the other hand, if there are no files already registered, | 1756 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). On |
| 1759 | Emacs uses the first system from @code{vc-handled-backends} that could | 1757 | the other hand, if there are no files already registered, Emacs uses |
| 1760 | register the file (for example, you cannot register a file under CVS if | 1758 | the first system from @code{vc-handled-backends} that could register |
| 1761 | its directory is not already part of a CVS tree); with the default | 1759 | the file (for example, you cannot register a file under CVS if its |
| 1762 | value of @code{vc-handled-backends}, this means that Emacs uses RCS in | 1760 | directory is not already part of a CVS tree); with the default value |
| 1763 | this situation. | 1761 | of @code{vc-handled-backends}, this means that Emacs uses RCS in this |
| 1762 | situation. | ||
| 1764 | 1763 | ||
| 1765 | If locking is in use, @kbd{C-x v i} leaves the file unlocked and | 1764 | If locking is in use, @kbd{C-x v i} leaves the file unlocked and |
| 1766 | read-only. Type @kbd{C-x v v} if you wish to start editing it. After | 1765 | read-only. Type @kbd{C-x v v} if you wish to start editing it. After |
| @@ -1815,14 +1814,16 @@ count. | |||
| 1815 | 1814 | ||
| 1816 | @item P | 1815 | @item P |
| 1817 | Move to the log of the previous file, when the logs of multiple files | 1816 | Move to the log of the previous file, when the logs of multiple files |
| 1818 | are in the log buffer (@pxref{VC Dired Mode}). Otherwise, just move | 1817 | are in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized |
| 1819 | to the beginning of the log. A numeric prefix argument is a repeat | 1818 | Emacs Features}). Otherwise, just move to the beginning of the log. A |
| 1820 | count, so @kbd{C-u 10 P} would move backward 10 files. | 1819 | numeric prefix argument is a repeat count, so @kbd{C-u 10 P} would |
| 1820 | move backward 10 files. | ||
| 1821 | 1821 | ||
| 1822 | @item N | 1822 | @item N |
| 1823 | Move to the log of the next file, when the logs of multiple files are | 1823 | Move to the log of the next file, when the logs of multiple files are |
| 1824 | in the log buffer (@pxref{VC Dired Mode}). It also takes a numeric | 1824 | in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized |
| 1825 | prefix argument as a repeat count. | 1825 | Emacs Features}). It also takes a numeric prefix argument as a repeat |
| 1826 | count. | ||
| 1826 | 1827 | ||
| 1827 | @item f | 1828 | @item f |
| 1828 | Visit the revision indicated at the current line, like typing @kbd{C-x | 1829 | Visit the revision indicated at the current line, like typing @kbd{C-x |
| @@ -1876,10 +1877,11 @@ change and then discover a trivial error in it; you can cancel the | |||
| 1876 | erroneous check-in, fix the error, and check the file in again. | 1877 | erroneous check-in, fix the error, and check the file in again. |
| 1877 | 1878 | ||
| 1878 | When @kbd{C-x v c} does not revert the buffer, it unexpands all | 1879 | When @kbd{C-x v c} does not revert the buffer, it unexpands all |
| 1879 | version control headers in the buffer instead (@pxref{Version Headers}). | 1880 | version control headers in the buffer instead (@pxref{Version |
| 1880 | This is because the buffer no longer corresponds to any existing | 1881 | Headers,,,emacs-xtra, Specialized Emacs Features}). This is because |
| 1881 | version. If you check it in again, the check-in process will expand the | 1882 | the buffer no longer corresponds to any existing version. If you |
| 1882 | headers properly for the new version number. | 1883 | check it in again, the check-in process will expand the headers |
| 1884 | properly for the new version number. | ||
| 1883 | 1885 | ||
| 1884 | However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header | 1886 | However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header |
| 1885 | automatically. If you use that header feature, you have to unexpand it | 1887 | automatically. If you use that header feature, you have to unexpand it |
| @@ -1891,142 +1893,6 @@ confirmation with @kbd{yes}. Note also that this command is disabled | |||
| 1891 | under CVS, because canceling versions is very dangerous and discouraged | 1893 | under CVS, because canceling versions is very dangerous and discouraged |
| 1892 | with CVS. | 1894 | with CVS. |
| 1893 | 1895 | ||
| 1894 | @node VC Dired Mode | ||
| 1895 | @subsubsection Dired under VC | ||
| 1896 | |||
| 1897 | @cindex PCL-CVS | ||
| 1898 | @pindex cvs | ||
| 1899 | @cindex CVS Dired Mode | ||
| 1900 | The VC Dired Mode described here works with all the version control | ||
| 1901 | systems that VC supports. Another more powerful facility, designed | ||
| 1902 | specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS, | ||
| 1903 | pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. | ||
| 1904 | |||
| 1905 | @kindex C-x v d | ||
| 1906 | @findex vc-directory | ||
| 1907 | When you are working on a large program, it is often useful to find | ||
| 1908 | out which files have changed within an entire directory tree, or to view | ||
| 1909 | the status of all files under version control at once, and to perform | ||
| 1910 | version control operations on collections of files. You can use the | ||
| 1911 | command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing | ||
| 1912 | that includes only files relevant for version control. | ||
| 1913 | |||
| 1914 | @vindex vc-dired-terse-display | ||
| 1915 | @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks | ||
| 1916 | much like an ordinary Dired buffer (@pxref{Dired}); however, normally it | ||
| 1917 | shows only the noteworthy files (those locked or not up-to-date). This | ||
| 1918 | is called @dfn{terse display}. If you set the variable | ||
| 1919 | @code{vc-dired-terse-display} to @code{nil}, then VC Dired shows all | ||
| 1920 | relevant files---those managed under version control, plus all | ||
| 1921 | subdirectories (@dfn{full display}). The command @kbd{v t} in a VC | ||
| 1922 | Dired buffer toggles between terse display and full display (@pxref{VC | ||
| 1923 | Dired Commands}). | ||
| 1924 | |||
| 1925 | @vindex vc-dired-recurse | ||
| 1926 | By default, VC Dired produces a recursive listing of noteworthy or | ||
| 1927 | relevant files at or below the given directory. You can change this by | ||
| 1928 | setting the variable @code{vc-dired-recurse} to @code{nil}; then VC | ||
| 1929 | Dired shows only the files in the given directory. | ||
| 1930 | |||
| 1931 | The line for an individual file shows the version control state in the | ||
| 1932 | place of the hard link count, owner, group, and size of the file. If | ||
| 1933 | the file is unmodified, in sync with the master file, the version | ||
| 1934 | control state shown is blank. Otherwise it consists of text in | ||
| 1935 | parentheses. Under RCS and SCCS, the name of the user locking the file | ||
| 1936 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 1937 | output is used. Here is an example using RCS: | ||
| 1938 | |||
| 1939 | @smallexample | ||
| 1940 | @group | ||
| 1941 | /home/jim/project: | ||
| 1942 | |||
| 1943 | -rw-r--r-- (jim) Apr 2 23:39 file1 | ||
| 1944 | -r--r--r-- Apr 5 20:21 file2 | ||
| 1945 | @end group | ||
| 1946 | @end smallexample | ||
| 1947 | |||
| 1948 | @noindent | ||
| 1949 | The files @samp{file1} and @samp{file2} are under version control, | ||
| 1950 | @samp{file1} is locked by user jim, and @samp{file2} is unlocked. | ||
| 1951 | |||
| 1952 | Here is an example using CVS: | ||
| 1953 | |||
| 1954 | @smallexample | ||
| 1955 | @group | ||
| 1956 | /home/joe/develop: | ||
| 1957 | |||
| 1958 | -rw-r--r-- (modified) Aug 2 1997 file1.c | ||
| 1959 | -rw-r--r-- Apr 4 20:09 file2.c | ||
| 1960 | -rw-r--r-- (merge) Sep 13 1996 file3.c | ||
| 1961 | @end group | ||
| 1962 | @end smallexample | ||
| 1963 | |||
| 1964 | Here @samp{file1.c} is modified with respect to the repository, and | ||
| 1965 | @samp{file2.c} is not. @samp{file3.c} is modified, but other changes | ||
| 1966 | have also been checked in to the repository---you need to merge them | ||
| 1967 | with the work file before you can check it in. | ||
| 1968 | |||
| 1969 | @vindex vc-stay-local | ||
| 1970 | @vindex vc-cvs-stay-local | ||
| 1971 | In the above, if the repository were on a remote machine, VC would | ||
| 1972 | only contact it when the variable @code{vc-stay-local} (or | ||
| 1973 | @code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is | ||
| 1974 | because access to the repository may be slow, or you may be working | ||
| 1975 | offline and not have access to the repository at all. As a | ||
| 1976 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 1977 | in the ``merge'' state; you would learn that only when you try to | ||
| 1978 | check-in your modified copy of the file, or use a command such as | ||
| 1979 | @kbd{C-x v m}. | ||
| 1980 | |||
| 1981 | In practice, this is not a problem because CVS handles this case | ||
| 1982 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 1983 | merge the remote changes into your work file first. The benefits of | ||
| 1984 | less network communication usually outweigh the disadvantage of not | ||
| 1985 | seeing remote changes immediately. | ||
| 1986 | |||
| 1987 | @vindex vc-directory-exclusion-list | ||
| 1988 | When VC Dired displays subdirectories (in the ``full'' display mode), | ||
| 1989 | it omits some that should never contain any files under version control. | ||
| 1990 | By default, this includes Version Control subdirectories such as | ||
| 1991 | @samp{RCS} and @samp{CVS}; you can customize this by setting the | ||
| 1992 | variable @code{vc-directory-exclusion-list}. | ||
| 1993 | |||
| 1994 | You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in | ||
| 1995 | ordinary Dired, that allows you to specify additional switches for the | ||
| 1996 | @samp{ls} command. | ||
| 1997 | |||
| 1998 | @node VC Dired Commands | ||
| 1999 | @subsubsection VC Dired Commands | ||
| 2000 | |||
| 2001 | All the usual Dired commands work normally in VC Dired mode, except | ||
| 2002 | for @kbd{v}, which is redefined as the version control prefix. You can | ||
| 2003 | invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by | ||
| 2004 | typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply | ||
| 2005 | to the file name on the current line. | ||
| 2006 | |||
| 2007 | The command @kbd{v v} (@code{vc-next-action}) operates on all the | ||
| 2008 | marked files, so that you can lock or check in several files at once. | ||
| 2009 | If it operates on more than one file, it handles each file according to | ||
| 2010 | its current state; thus, it might lock one file, but check in another | ||
| 2011 | file. This could be confusing; it is up to you to avoid confusing | ||
| 2012 | behavior by marking a set of files that are in a similar state. If no | ||
| 2013 | files are marked, @kbd{v v} operates on the file in the current line. | ||
| 2014 | |||
| 2015 | If any files call for check-in, @kbd{v v} reads a single log entry, | ||
| 2016 | then uses it for all the files being checked in. This is convenient for | ||
| 2017 | registering or checking in several files at once, as part of the same | ||
| 2018 | change. | ||
| 2019 | |||
| 2020 | @findex vc-dired-toggle-terse-mode | ||
| 2021 | @findex vc-dired-mark-locked | ||
| 2022 | You can toggle between terse display (only locked files, or files not | ||
| 2023 | up-to-date) and full display at any time by typing @kbd{v t} | ||
| 2024 | (@code{vc-dired-toggle-terse-mode}). There is also a special command | ||
| 2025 | @kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently | ||
| 2026 | locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l | ||
| 2027 | t k} is another way to delete from the buffer all files except those | ||
| 2028 | currently locked. | ||
| 2029 | |||
| 2030 | @node Branches | 1896 | @node Branches |
| 2031 | @subsection Multiple Branches of a File | 1897 | @subsection Multiple Branches of a File |
| 2032 | @cindex branch (version control) | 1898 | @cindex branch (version control) |
| @@ -2205,9 +2071,10 @@ own choice of selected versions, but all share the same common RCS | |||
| 2205 | records. | 2071 | records. |
| 2206 | 2072 | ||
| 2207 | This technique works reliably and automatically, provided that the | 2073 | This technique works reliably and automatically, provided that the |
| 2208 | source files contain RCS version headers (@pxref{Version Headers}). The | 2074 | source files contain RCS version headers (@pxref{Version |
| 2209 | headers enable Emacs to be sure, at all times, which version number is | 2075 | Headers,,,emacs-xtra, Specialized Emacs Features}). The headers enable |
| 2210 | present in the work file. | 2076 | Emacs to be sure, at all times, which version number is present in the |
| 2077 | work file. | ||
| 2211 | 2078 | ||
| 2212 | If the files do not have version headers, you must instead tell Emacs | 2079 | If the files do not have version headers, you must instead tell Emacs |
| 2213 | explicitly in each session which branch you are working on. To do this, | 2080 | explicitly in each session which branch you are working on. To do this, |
| @@ -2215,730 +2082,6 @@ first find the file, then type @kbd{C-u C-x v v} and specify the correct | |||
| 2215 | branch number. This ensures that Emacs knows which branch it is using | 2082 | branch number. This ensures that Emacs knows which branch it is using |
| 2216 | during this particular editing session. | 2083 | during this particular editing session. |
| 2217 | 2084 | ||
| 2218 | @node Remote Repositories | ||
| 2219 | @subsection Remote Repositories | ||
| 2220 | @cindex remote repositories (CVS) | ||
| 2221 | |||
| 2222 | A common way of using CVS is to set up a central CVS repository on | ||
| 2223 | some Internet host, then have each developer check out a personal | ||
| 2224 | working copy of the files on his local machine. Committing changes to | ||
| 2225 | the repository, and picking up changes from other users into one's own | ||
| 2226 | working area, then works by direct interactions with the CVS server. | ||
| 2227 | |||
| 2228 | One difficulty is that access to the CVS server is often slow, and | ||
| 2229 | that developers might need to work off-line as well. VC is designed | ||
| 2230 | to reduce the amount of network interaction necessary. | ||
| 2231 | |||
| 2232 | @menu | ||
| 2233 | * Version Backups:: Keeping local copies of repository versions. | ||
| 2234 | * Local Version Control:: Using another version system for local editing. | ||
| 2235 | @end menu | ||
| 2236 | |||
| 2237 | @node Version Backups | ||
| 2238 | @subsubsection Version Backups | ||
| 2239 | @cindex version backups | ||
| 2240 | |||
| 2241 | @cindex automatic version backups | ||
| 2242 | When VC sees that the CVS repository for a file is on a remote | ||
| 2243 | machine, it automatically makes local backups of unmodified versions | ||
| 2244 | of the file---@dfn{automatic version backups}. This means that you | ||
| 2245 | can compare the file to the repository version (@kbd{C-x v =}), or | ||
| 2246 | revert to that version (@kbd{C-x v u}), without any network | ||
| 2247 | interactions. | ||
| 2248 | |||
| 2249 | The local copy of the unmodified file is called a @dfn{version | ||
| 2250 | backup} to indicate that it corresponds exactly to a version that is | ||
| 2251 | stored in the repository. Note that version backups are not the same | ||
| 2252 | as ordinary Emacs backup files (@pxref{Backup}). But they follow a | ||
| 2253 | similar naming convention. | ||
| 2254 | |||
| 2255 | For a file that comes from a remote CVS repository, VC makes a | ||
| 2256 | version backup whenever you save the first changes to the file, and | ||
| 2257 | removes it after you have committed your modified version to the | ||
| 2258 | repository. You can disable the making of automatic version backups by | ||
| 2259 | setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | ||
| 2260 | |||
| 2261 | @cindex manual version backups | ||
| 2262 | The name of the automatic version backup for version @var{version} | ||
| 2263 | of file @var{file} is @code{@var{file}.~@var{version}.~}. This is | ||
| 2264 | almost the same as the name used by @kbd{C-x v ~} (@pxref{Old | ||
| 2265 | Versions}), the only difference being the additional dot (@samp{.}) | ||
| 2266 | after the version number. This similarity is intentional, because | ||
| 2267 | both kinds of files store the same kind of information. The file made | ||
| 2268 | by @kbd{C-x v ~} acts as a @dfn{manual version backup}. | ||
| 2269 | |||
| 2270 | All the VC commands that operate on old versions of a file can use | ||
| 2271 | both kinds of version backups. For instance, @kbd{C-x v ~} uses | ||
| 2272 | either an automatic or a manual version backup, if possible, to get | ||
| 2273 | the contents of the version you request. Likewise, @kbd{C-x v =} and | ||
| 2274 | @kbd{C-x v u} use either an automatic or a manual version backup, if | ||
| 2275 | one of them exists, to get the contents of a version to compare or | ||
| 2276 | revert to. If you changed a file outside of Emacs, so that no | ||
| 2277 | automatic version backup was created for the previous text, you can | ||
| 2278 | create a manual backup of that version using @kbd{C-x v ~}, and thus | ||
| 2279 | obtain the benefit of the local copy for Emacs commands. | ||
| 2280 | |||
| 2281 | The only difference in Emacs's handling of manual and automatic | ||
| 2282 | version backups, once they exist, is that Emacs deletes automatic | ||
| 2283 | version backups when you commit to the repository. By contrast, | ||
| 2284 | manual version backups remain until you delete them. | ||
| 2285 | |||
| 2286 | @node Local Version Control | ||
| 2287 | @subsubsection Local Version Control | ||
| 2288 | @cindex local version control | ||
| 2289 | @cindex local back end (version control) | ||
| 2290 | |||
| 2291 | When you make many changes to a file that comes from a remote | ||
| 2292 | repository, it can be convenient to have version control on your local | ||
| 2293 | machine as well. You can then record intermediate versions, revert to | ||
| 2294 | a previous state, etc., before you actually commit your changes to the | ||
| 2295 | remote server. | ||
| 2296 | |||
| 2297 | VC lets you do this by putting a file under a second, local version | ||
| 2298 | control system, so that the file is effectively registered in two | ||
| 2299 | systems at the same time. For the description here, we will assume | ||
| 2300 | that the remote system is CVS, and you use RCS locally, although the | ||
| 2301 | mechanism works with any combination of version control systems | ||
| 2302 | (@dfn{back ends}). | ||
| 2303 | |||
| 2304 | To make it work with other back ends, you must make sure that the | ||
| 2305 | ``more local'' back end comes before the ``more remote'' back end in | ||
| 2306 | the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By | ||
| 2307 | default, this variable is set up so that you can use remote CVS and | ||
| 2308 | local RCS as described here. | ||
| 2309 | |||
| 2310 | To start using local RCS for a file that comes from a remote CVS | ||
| 2311 | server, you must @emph{register the file in RCS}, by typing @kbd{C-u | ||
| 2312 | C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a | ||
| 2313 | prefix argument, and specify RCS as the back end.) | ||
| 2314 | |||
| 2315 | You can do this at any time; it does not matter whether you have | ||
| 2316 | already modified the file with respect to the version in the CVS | ||
| 2317 | repository. If possible, VC tries to make the RCS master start with | ||
| 2318 | the unmodified repository version, then checks in any local changes | ||
| 2319 | as a new version. This works if you have not made any changes yet, or | ||
| 2320 | if the unmodified repository version exists locally as a version | ||
| 2321 | backup (@pxref{Version Backups}). If the unmodified version is not | ||
| 2322 | available locally, the RCS master starts with the modified version; | ||
| 2323 | the only drawback to this is that you cannot compare your changes | ||
| 2324 | locally to what is stored in the repository. | ||
| 2325 | |||
| 2326 | The version number of the RCS master is derived from the current CVS | ||
| 2327 | version, starting a branch from it. For example, if the current CVS | ||
| 2328 | version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | ||
| 2329 | the RCS master will be identical to version 1.23 under CVS; your first | ||
| 2330 | changes are checked in as 1.23.1.1. (If the unmodified file is not | ||
| 2331 | available locally, VC will check in the modified file twice, both as | ||
| 2332 | 1.23 and 1.23.1.1, to make the revision numbers consistent.) | ||
| 2333 | |||
| 2334 | If you do not use locking under CVS (the default), locking is also | ||
| 2335 | disabled for RCS, so that editing under RCS works exactly as under | ||
| 2336 | CVS. | ||
| 2337 | |||
| 2338 | When you are done with local editing, you can commit the final version | ||
| 2339 | back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 2340 | This initializes the log entry buffer (@pxref{Log Buffer}) to contain | ||
| 2341 | all the log entries you have recorded in the RCS master; you can edit | ||
| 2342 | them as you wish, and then commit in CVS by typing @kbd{C-c C-c}. If | ||
| 2343 | the commit is successful, VC removes the RCS master, so that the file | ||
| 2344 | is once again registered under CVS only. (The RCS master is not | ||
| 2345 | actually deleted, just renamed by appending @samp{~} to the name, so | ||
| 2346 | that you can refer to it later if you wish.) | ||
| 2347 | |||
| 2348 | While using local RCS, you can pick up recent changes from the CVS | ||
| 2349 | repository into your local file, or commit some of your changes back | ||
| 2350 | to CVS, without terminating local RCS version control. To do this, | ||
| 2351 | switch to the CVS back end temporarily, with the @kbd{C-x v b} command: | ||
| 2352 | |||
| 2353 | @table @kbd | ||
| 2354 | @item C-x v b | ||
| 2355 | Switch to another back end that the current file is registered | ||
| 2356 | under (@code{vc-switch-backend}). | ||
| 2357 | |||
| 2358 | @item C-u C-x v b @var{backend} @key{RET} | ||
| 2359 | Switch to @var{backend} for the current file. | ||
| 2360 | @end table | ||
| 2361 | |||
| 2362 | @kindex C-x v b | ||
| 2363 | @findex vc-switch-backend | ||
| 2364 | @kbd{C-x v b} does not change the buffer contents, or any files; it | ||
| 2365 | only changes VC's perspective on how to handle the file. Any | ||
| 2366 | subsequent VC commands for that file will operate on the back end that | ||
| 2367 | is currently selected. | ||
| 2368 | |||
| 2369 | If the current file is registered in more than one back end, typing | ||
| 2370 | @kbd{C-x v b} ``cycles'' through all of these back ends. With a | ||
| 2371 | prefix argument, it asks for the back end to use in the minibuffer. | ||
| 2372 | |||
| 2373 | Thus, if you are using local RCS, and you want to pick up some recent | ||
| 2374 | changes in the file from remote CVS, first visit the file, then type | ||
| 2375 | @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m | ||
| 2376 | @key{RET}} to merge the news (@pxref{Merging}). You can then switch | ||
| 2377 | back to RCS by typing @kbd{C-x v b} again, and continue to edit | ||
| 2378 | locally. | ||
| 2379 | |||
| 2380 | But if you do this, the revision numbers in the RCS master no longer | ||
| 2381 | correspond to those of CVS. Technically, this is not a problem, but | ||
| 2382 | it can become difficult to keep track of what is in the CVS repository | ||
| 2383 | and what is not. So we suggest that you return from time to time to | ||
| 2384 | CVS-only operation, by committing your local changes back to the | ||
| 2385 | repository using @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 2386 | |||
| 2387 | @node Snapshots | ||
| 2388 | @subsection Snapshots | ||
| 2389 | @cindex snapshots and version control | ||
| 2390 | |||
| 2391 | A @dfn{snapshot} is a named set of file versions (one for each | ||
| 2392 | registered file) that you can treat as a unit. One important kind of | ||
| 2393 | snapshot is a @dfn{release}, a (theoretically) stable version of the | ||
| 2394 | system that is ready for distribution to users. | ||
| 2395 | |||
| 2396 | @menu | ||
| 2397 | * Making Snapshots:: The snapshot facilities. | ||
| 2398 | * Snapshot Caveats:: Things to be careful of when using snapshots. | ||
| 2399 | @end menu | ||
| 2400 | |||
| 2401 | @node Making Snapshots | ||
| 2402 | @subsubsection Making and Using Snapshots | ||
| 2403 | |||
| 2404 | There are two basic commands for snapshots; one makes a | ||
| 2405 | snapshot with a given name, the other retrieves a named snapshot. | ||
| 2406 | |||
| 2407 | @table @code | ||
| 2408 | @kindex C-x v s | ||
| 2409 | @findex vc-create-snapshot | ||
| 2410 | @item C-x v s @var{name} @key{RET} | ||
| 2411 | Define the last saved versions of every registered file in or under the | ||
| 2412 | current directory as a snapshot named @var{name} | ||
| 2413 | (@code{vc-create-snapshot}). | ||
| 2414 | |||
| 2415 | @kindex C-x v r | ||
| 2416 | @findex vc-retrieve-snapshot | ||
| 2417 | @item C-x v r @var{name} @key{RET} | ||
| 2418 | For all registered files at or below the current directory level, select | ||
| 2419 | whatever versions correspond to the snapshot @var{name} | ||
| 2420 | (@code{vc-retrieve-snapshot}). | ||
| 2421 | |||
| 2422 | This command reports an error if any files are locked at or below the | ||
| 2423 | current directory, without changing anything; this is to avoid | ||
| 2424 | overwriting work in progress. | ||
| 2425 | @end table | ||
| 2426 | |||
| 2427 | A snapshot uses a very small amount of resources---just enough to record | ||
| 2428 | the list of file names and which version belongs to the snapshot. Thus, | ||
| 2429 | you need not hesitate to create snapshots whenever they are useful. | ||
| 2430 | |||
| 2431 | You can give a snapshot name as an argument to @kbd{C-x v =} or | ||
| 2432 | @kbd{C-x v ~} (@pxref{Old Versions}). Thus, you can use it to compare a | ||
| 2433 | snapshot against the current files, or two snapshots against each other, | ||
| 2434 | or a snapshot against a named version. | ||
| 2435 | |||
| 2436 | @node Snapshot Caveats | ||
| 2437 | @subsubsection Snapshot Caveats | ||
| 2438 | |||
| 2439 | @cindex named configurations (RCS) | ||
| 2440 | VC's snapshot facilities are modeled on RCS's named-configuration | ||
| 2441 | support. They use RCS's native facilities for this, so | ||
| 2442 | snapshots made using RCS through VC are visible even when you bypass VC. | ||
| 2443 | |||
| 2444 | With CVS, Meta-CVS, and Subversion, VC also uses the native | ||
| 2445 | mechanism provided by that back end to make snapshots and retrieve them | ||
| 2446 | (@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion). | ||
| 2447 | |||
| 2448 | @c worded verbosely to avoid overfull hbox. | ||
| 2449 | For SCCS, VC implements snapshots itself. The files it uses contain | ||
| 2450 | name/file/version-number triples. These snapshots are visible only | ||
| 2451 | through VC. | ||
| 2452 | |||
| 2453 | There is no support for VC snapshots using GNU Arch yet. | ||
| 2454 | |||
| 2455 | A snapshot is a set of checked-in versions. So make sure that all the | ||
| 2456 | files are checked in and not locked when you make a snapshot. | ||
| 2457 | |||
| 2458 | File renaming and deletion can create some difficulties with snapshots. | ||
| 2459 | This is not a VC-specific problem, but a general design issue in version | ||
| 2460 | control systems that no one has solved very well yet. | ||
| 2461 | |||
| 2462 | If you rename a registered file, you need to rename its master along | ||
| 2463 | with it (the command @code{vc-rename-file} does this automatically). If | ||
| 2464 | you are using SCCS, you must also update the records of the snapshot, to | ||
| 2465 | mention the file by its new name (@code{vc-rename-file} does this, | ||
| 2466 | too). An old snapshot that refers to a master file that no longer | ||
| 2467 | exists under the recorded name is invalid; VC can no longer retrieve | ||
| 2468 | it. It would be beyond the scope of this manual to explain enough about | ||
| 2469 | RCS and SCCS to explain how to update the snapshots by hand. | ||
| 2470 | |||
| 2471 | Using @code{vc-rename-file} makes the snapshot remain valid for | ||
| 2472 | retrieval, but it does not solve all problems. For example, some of the | ||
| 2473 | files in your program probably refer to others by name. At the very | ||
| 2474 | least, the makefile probably mentions the file that you renamed. If you | ||
| 2475 | retrieve an old snapshot, the renamed file is retrieved under its new | ||
| 2476 | name, which is not the name that the makefile expects. So the program | ||
| 2477 | won't really work as retrieved. | ||
| 2478 | |||
| 2479 | @node Miscellaneous VC | ||
| 2480 | @subsection Miscellaneous Commands and Features of VC | ||
| 2481 | |||
| 2482 | This section explains the less-frequently-used features of VC. | ||
| 2483 | |||
| 2484 | @menu | ||
| 2485 | * Change Logs and VC:: Generating a change log file from log entries. | ||
| 2486 | * Renaming and VC:: A command to rename both the source and master | ||
| 2487 | file correctly. | ||
| 2488 | * Version Headers:: Inserting version control headers into working files. | ||
| 2489 | @end menu | ||
| 2490 | |||
| 2491 | @node Change Logs and VC | ||
| 2492 | @subsubsection Change Logs and VC | ||
| 2493 | |||
| 2494 | If you use RCS or CVS for a program and also maintain a change log | ||
| 2495 | file for it (@pxref{Change Log}), you can generate change log entries | ||
| 2496 | automatically from the version control log entries: | ||
| 2497 | |||
| 2498 | @table @kbd | ||
| 2499 | @item C-x v a | ||
| 2500 | @kindex C-x v a | ||
| 2501 | @findex vc-update-change-log | ||
| 2502 | Visit the current directory's change log file and, for registered files | ||
| 2503 | in that directory, create new entries for versions checked in since the | ||
| 2504 | most recent entry in the change log file. | ||
| 2505 | (@code{vc-update-change-log}). | ||
| 2506 | |||
| 2507 | This command works with RCS or CVS only, not with any of the other | ||
| 2508 | back ends. | ||
| 2509 | |||
| 2510 | @item C-u C-x v a | ||
| 2511 | As above, but only find entries for the current buffer's file. | ||
| 2512 | |||
| 2513 | @item M-1 C-x v a | ||
| 2514 | As above, but find entries for all the currently visited files that are | ||
| 2515 | maintained with version control. This works only with RCS, and it puts | ||
| 2516 | all entries in the log for the default directory, which may not be | ||
| 2517 | appropriate. | ||
| 2518 | @end table | ||
| 2519 | |||
| 2520 | For example, suppose the first line of @file{ChangeLog} is dated | ||
| 2521 | 1999-04-10, and that the only check-in since then was by Nathaniel | ||
| 2522 | Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log | ||
| 2523 | messages that start with `#'.}. Then @kbd{C-x v a} visits | ||
| 2524 | @file{ChangeLog} and inserts text like this: | ||
| 2525 | |||
| 2526 | @iftex | ||
| 2527 | @medbreak | ||
| 2528 | @end iftex | ||
| 2529 | @smallexample | ||
| 2530 | @group | ||
| 2531 | 1999-05-22 Nathaniel Bowditch <nat@@apn.org> | ||
| 2532 | |||
| 2533 | * rcs2log: Ignore log messages that start with `#'. | ||
| 2534 | @end group | ||
| 2535 | @end smallexample | ||
| 2536 | @iftex | ||
| 2537 | @medbreak | ||
| 2538 | @end iftex | ||
| 2539 | |||
| 2540 | @noindent | ||
| 2541 | You can then edit the new change log entry further as you wish. | ||
| 2542 | |||
| 2543 | Some of the new change log entries may duplicate what's already in | ||
| 2544 | ChangeLog. You will have to remove these duplicates by hand. | ||
| 2545 | |||
| 2546 | Normally, the log entry for file @file{foo} is displayed as @samp{* | ||
| 2547 | foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | ||
| 2548 | if the text of the log entry starts with @w{@samp{(@var{functionname}): | ||
| 2549 | }}. For example, if the log entry for @file{vc.el} is | ||
| 2550 | @samp{(vc-do-command): Check call-process status.}, then the text in | ||
| 2551 | @file{ChangeLog} looks like this: | ||
| 2552 | |||
| 2553 | @iftex | ||
| 2554 | @medbreak | ||
| 2555 | @end iftex | ||
| 2556 | @smallexample | ||
| 2557 | @group | ||
| 2558 | 1999-05-06 Nathaniel Bowditch <nat@@apn.org> | ||
| 2559 | |||
| 2560 | * vc.el (vc-do-command): Check call-process status. | ||
| 2561 | @end group | ||
| 2562 | @end smallexample | ||
| 2563 | @iftex | ||
| 2564 | @medbreak | ||
| 2565 | @end iftex | ||
| 2566 | |||
| 2567 | When @kbd{C-x v a} adds several change log entries at once, it groups | ||
| 2568 | related log entries together if they all are checked in by the same | ||
| 2569 | author at nearly the same time. If the log entries for several such | ||
| 2570 | files all have the same text, it coalesces them into a single entry. | ||
| 2571 | For example, suppose the most recent check-ins have the following log | ||
| 2572 | entries: | ||
| 2573 | |||
| 2574 | @flushleft | ||
| 2575 | @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} | ||
| 2576 | @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} | ||
| 2577 | @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} | ||
| 2578 | @end flushleft | ||
| 2579 | |||
| 2580 | @noindent | ||
| 2581 | They appear like this in @file{ChangeLog}: | ||
| 2582 | |||
| 2583 | @iftex | ||
| 2584 | @medbreak | ||
| 2585 | @end iftex | ||
| 2586 | @smallexample | ||
| 2587 | @group | ||
| 2588 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 2589 | |||
| 2590 | * vc.texinfo: Fix expansion typos. | ||
| 2591 | |||
| 2592 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 2593 | @end group | ||
| 2594 | @end smallexample | ||
| 2595 | @iftex | ||
| 2596 | @medbreak | ||
| 2597 | @end iftex | ||
| 2598 | |||
| 2599 | Normally, @kbd{C-x v a} separates log entries by a blank line, but you | ||
| 2600 | can mark several related log entries to be clumped together (without an | ||
| 2601 | intervening blank line) by starting the text of each related log entry | ||
| 2602 | with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label | ||
| 2603 | itself is not copied to @file{ChangeLog}. For example, suppose the log | ||
| 2604 | entries are: | ||
| 2605 | |||
| 2606 | @flushleft | ||
| 2607 | @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} | ||
| 2608 | @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 2609 | @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 2610 | @end flushleft | ||
| 2611 | |||
| 2612 | @noindent | ||
| 2613 | Then the text in @file{ChangeLog} looks like this: | ||
| 2614 | |||
| 2615 | @iftex | ||
| 2616 | @medbreak | ||
| 2617 | @end iftex | ||
| 2618 | @smallexample | ||
| 2619 | @group | ||
| 2620 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 2621 | |||
| 2622 | * vc.texinfo: Fix expansion typos. | ||
| 2623 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 2624 | @end group | ||
| 2625 | @end smallexample | ||
| 2626 | @iftex | ||
| 2627 | @medbreak | ||
| 2628 | @end iftex | ||
| 2629 | |||
| 2630 | A log entry whose text begins with @samp{#} is not copied to | ||
| 2631 | @file{ChangeLog}. For example, if you merely fix some misspellings in | ||
| 2632 | comments, you can log the change with an entry beginning with @samp{#} | ||
| 2633 | to avoid putting such trivia into @file{ChangeLog}. | ||
| 2634 | |||
| 2635 | @node Renaming and VC | ||
| 2636 | @subsubsection Renaming VC Work Files and Master Files | ||
| 2637 | |||
| 2638 | @findex vc-rename-file | ||
| 2639 | When you rename a registered file, you must also rename its master | ||
| 2640 | file correspondingly to get proper results. Use @code{vc-rename-file} | ||
| 2641 | to rename the source file as you specify, and rename its master file | ||
| 2642 | accordingly. It also updates any snapshots (@pxref{Snapshots}) that | ||
| 2643 | mention the file, so that they use the new name; despite this, the | ||
| 2644 | snapshot thus modified may not completely work (@pxref{Snapshot | ||
| 2645 | Caveats}). | ||
| 2646 | |||
| 2647 | Some back ends do not provide an explicit rename operation to their | ||
| 2648 | repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} | ||
| 2649 | on the original and renamed buffers and provide the necessary edit | ||
| 2650 | log. | ||
| 2651 | |||
| 2652 | You cannot use @code{vc-rename-file} on a file that is locked by | ||
| 2653 | someone else. | ||
| 2654 | |||
| 2655 | @node Version Headers | ||
| 2656 | @subsubsection Inserting Version Control Headers | ||
| 2657 | |||
| 2658 | Sometimes it is convenient to put version identification strings | ||
| 2659 | directly into working files. Certain special strings called | ||
| 2660 | @dfn{version headers} are replaced in each successive version by the | ||
| 2661 | number of that version, the name of the user who created it, and other | ||
| 2662 | relevant information. All of the back ends that VC supports have such | ||
| 2663 | a mechanism, except GNU Arch. | ||
| 2664 | |||
| 2665 | VC does not normally use the information contained in these headers. | ||
| 2666 | The exception is RCS---with RCS, version headers are sometimes more | ||
| 2667 | reliable than the master file to determine which version of the file | ||
| 2668 | you are editing. Note that in a multi-branch environment, version | ||
| 2669 | headers are necessary to make VC behave correctly (@pxref{Multi-User | ||
| 2670 | Branching}). | ||
| 2671 | |||
| 2672 | Searching for RCS version headers is controlled by the variable | ||
| 2673 | @code{vc-consult-headers}. If it is non-@code{nil} (the default), | ||
| 2674 | Emacs searches for headers to determine the version number you are | ||
| 2675 | editing. Setting it to @code{nil} disables this feature. | ||
| 2676 | |||
| 2677 | Note that although CVS uses the same kind of version headers as RCS | ||
| 2678 | does, VC never searches for these headers if you are using CVS, | ||
| 2679 | regardless of the above setting. | ||
| 2680 | |||
| 2681 | @kindex C-x v h | ||
| 2682 | @findex vc-insert-headers | ||
| 2683 | You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to | ||
| 2684 | insert a suitable header string. | ||
| 2685 | |||
| 2686 | @table @kbd | ||
| 2687 | @item C-x v h | ||
| 2688 | Insert headers in a file for use with your version-control system. | ||
| 2689 | @end table | ||
| 2690 | |||
| 2691 | @vindex vc-@var{backend}-header | ||
| 2692 | The default header string is @samp{@w{$}Id$} for RCS and | ||
| 2693 | @samp{@w{%}W%} for SCCS. You can specify other headers to insert by | ||
| 2694 | setting the variables @code{vc-@var{backend}-header} where | ||
| 2695 | @var{backend} is @code{rcs} or @code{sccs}. | ||
| 2696 | |||
| 2697 | Instead of a single string, you can specify a list of strings; then | ||
| 2698 | each string in the list is inserted as a separate header on a line of | ||
| 2699 | its own. | ||
| 2700 | |||
| 2701 | It may be necessary to use apparently-superfluous backslashes when | ||
| 2702 | writing the strings that you put in this variable. For instance, you | ||
| 2703 | might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra | ||
| 2704 | backslash prevents the string constant from being interpreted as a | ||
| 2705 | header, if the Emacs Lisp file containing it is maintained with | ||
| 2706 | version control. | ||
| 2707 | |||
| 2708 | @vindex vc-comment-alist | ||
| 2709 | Each header is inserted surrounded by tabs, inside comment delimiters, | ||
| 2710 | on a new line at point. Normally the ordinary comment | ||
| 2711 | start and comment end strings of the current mode are used, but for | ||
| 2712 | certain modes, there are special comment delimiters for this purpose; | ||
| 2713 | the variable @code{vc-comment-alist} specifies them. Each element of | ||
| 2714 | this list has the form @code{(@var{mode} @var{starter} @var{ender})}. | ||
| 2715 | |||
| 2716 | @vindex vc-static-header-alist | ||
| 2717 | The variable @code{vc-static-header-alist} specifies further strings | ||
| 2718 | to add based on the name of the buffer. Its value should be a list of | ||
| 2719 | elements of the form @code{(@var{regexp} . @var{format})}. Whenever | ||
| 2720 | @var{regexp} matches the buffer name, @var{format} is inserted as part | ||
| 2721 | of the header. A header line is inserted for each element that matches | ||
| 2722 | the buffer name, and for each string specified by | ||
| 2723 | @code{vc-@var{backend}-header}. The header line is made by processing the | ||
| 2724 | string from @code{vc-@var{backend}-header} with the format taken from the | ||
| 2725 | element. The default value for @code{vc-static-header-alist} is as follows: | ||
| 2726 | |||
| 2727 | @example | ||
| 2728 | @group | ||
| 2729 | (("\\.c$" . | ||
| 2730 | "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ | ||
| 2731 | #endif /* lint */\n")) | ||
| 2732 | @end group | ||
| 2733 | @end example | ||
| 2734 | |||
| 2735 | @noindent | ||
| 2736 | It specifies insertion of text of this form: | ||
| 2737 | |||
| 2738 | @example | ||
| 2739 | @group | ||
| 2740 | |||
| 2741 | #ifndef lint | ||
| 2742 | static char vcid[] = "@var{string}"; | ||
| 2743 | #endif /* lint */ | ||
| 2744 | @end group | ||
| 2745 | @end example | ||
| 2746 | |||
| 2747 | @noindent | ||
| 2748 | Note that the text above starts with a blank line. | ||
| 2749 | |||
| 2750 | If you use more than one version header in a file, put them close | ||
| 2751 | together in the file. The mechanism in @code{revert-buffer} that | ||
| 2752 | preserves markers may not handle markers positioned between two version | ||
| 2753 | headers. | ||
| 2754 | |||
| 2755 | @node Customizing VC | ||
| 2756 | @subsection Customizing VC | ||
| 2757 | |||
| 2758 | @vindex vc-handled-backends | ||
| 2759 | The variable @code{vc-handled-backends} determines which version | ||
| 2760 | control systems VC should handle. The default value is @code{(RCS CVS | ||
| 2761 | SVN SCCS Arch MCVS)}, so it contains all six version systems that are | ||
| 2762 | currently supported. If you want VC to ignore one or more of these | ||
| 2763 | systems, exclude its name from the list. To disable VC entirely, set | ||
| 2764 | this variable to @code{nil}. | ||
| 2765 | |||
| 2766 | The order of systems in the list is significant: when you visit a file | ||
| 2767 | registered in more than one system (@pxref{Local Version Control}), | ||
| 2768 | VC uses the system that comes first in @code{vc-handled-backends} by | ||
| 2769 | default. The order is also significant when you register a file for | ||
| 2770 | the first time, @pxref{Registering} for details. | ||
| 2771 | |||
| 2772 | @menu | ||
| 2773 | * General VC Options:: Options that apply to multiple back ends. | ||
| 2774 | * RCS and SCCS:: Options for RCS and SCCS. | ||
| 2775 | * CVS Options:: Options for CVS. | ||
| 2776 | @end menu | ||
| 2777 | |||
| 2778 | @node General VC Options | ||
| 2779 | @subsubsection General Options | ||
| 2780 | |||
| 2781 | @vindex vc-make-backup-files | ||
| 2782 | Emacs normally does not save backup files for source files that are | ||
| 2783 | maintained with version control. If you want to make backup files even | ||
| 2784 | for files that use version control, set the variable | ||
| 2785 | @code{vc-make-backup-files} to a non-@code{nil} value. | ||
| 2786 | |||
| 2787 | @vindex vc-keep-workfiles | ||
| 2788 | Normally the work file exists all the time, whether it is locked or | ||
| 2789 | not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking | ||
| 2790 | in a new version with @kbd{C-x v v} deletes the work file; but any | ||
| 2791 | attempt to visit the file with Emacs creates it again. (With CVS, work | ||
| 2792 | files are always kept.) | ||
| 2793 | |||
| 2794 | @vindex vc-follow-symlinks | ||
| 2795 | Editing a version-controlled file through a symbolic link can be | ||
| 2796 | dangerous. It bypasses the version control system---you can edit the | ||
| 2797 | file without locking it, and fail to check your changes in. Also, | ||
| 2798 | your changes might overwrite those of another user. To protect against | ||
| 2799 | this, VC checks each symbolic link that you visit, to see if it points | ||
| 2800 | to a file under version control. | ||
| 2801 | |||
| 2802 | The variable @code{vc-follow-symlinks} controls what to do when a | ||
| 2803 | symbolic link points to a version-controlled file. If it is @code{nil}, | ||
| 2804 | VC only displays a warning message. If it is @code{t}, VC automatically | ||
| 2805 | follows the link, and visits the real file instead, telling you about | ||
| 2806 | this in the echo area. If the value is @code{ask} (the default), VC | ||
| 2807 | asks you each time whether to follow the link. | ||
| 2808 | |||
| 2809 | @vindex vc-suppress-confirm | ||
| 2810 | If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} | ||
| 2811 | and @kbd{C-x v i} can save the current buffer without asking, and | ||
| 2812 | @kbd{C-x v u} also operates without asking for confirmation. (This | ||
| 2813 | variable does not affect @kbd{C-x v c}; that operation is so drastic | ||
| 2814 | that it should always ask for confirmation.) | ||
| 2815 | |||
| 2816 | @vindex vc-command-messages | ||
| 2817 | VC mode does much of its work by running the shell commands for RCS, | ||
| 2818 | CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC | ||
| 2819 | displays messages to indicate which shell commands it runs, and | ||
| 2820 | additional messages when the commands finish. | ||
| 2821 | |||
| 2822 | @vindex vc-path | ||
| 2823 | You can specify additional directories to search for version control | ||
| 2824 | programs by setting the variable @code{vc-path}. These directories | ||
| 2825 | are searched before the usual search path. It is rarely necessary to | ||
| 2826 | set this variable, because VC normally finds the proper files | ||
| 2827 | automatically. | ||
| 2828 | |||
| 2829 | @node RCS and SCCS | ||
| 2830 | @subsubsection Options for RCS and SCCS | ||
| 2831 | |||
| 2832 | @cindex non-strict locking (RCS) | ||
| 2833 | @cindex locking, non-strict (RCS) | ||
| 2834 | By default, RCS uses locking to coordinate the activities of several | ||
| 2835 | users, but there is a mode called @dfn{non-strict locking} in which | ||
| 2836 | you can check-in changes without locking the file first. Use | ||
| 2837 | @samp{rcs -U} to switch to non-strict locking for a particular file, | ||
| 2838 | see the @code{rcs} manual page for details. | ||
| 2839 | |||
| 2840 | When deducing the version control state of an RCS file, VC first | ||
| 2841 | looks for an RCS version header string in the file (@pxref{Version | ||
| 2842 | Headers}). If there is no header string, VC normally looks at the | ||
| 2843 | file permissions of the work file; this is fast. But there might be | ||
| 2844 | situations when the file permissions cannot be trusted. In this case | ||
| 2845 | the master file has to be consulted, which is rather expensive. Also | ||
| 2846 | the master file can only tell you @emph{if} there's any lock on the | ||
| 2847 | file, but not whether your work file really contains that locked | ||
| 2848 | version. | ||
| 2849 | |||
| 2850 | @vindex vc-consult-headers | ||
| 2851 | You can tell VC not to use version headers to determine the file | ||
| 2852 | status by setting @code{vc-consult-headers} to @code{nil}. VC then | ||
| 2853 | always uses the file permissions (if it is supposed to trust them), or | ||
| 2854 | else checks the master file. | ||
| 2855 | |||
| 2856 | @vindex vc-mistrust-permissions | ||
| 2857 | You can specify the criterion for whether to trust the file | ||
| 2858 | permissions by setting the variable @code{vc-mistrust-permissions}. | ||
| 2859 | Its value can be @code{t} (always mistrust the file permissions and | ||
| 2860 | check the master file), @code{nil} (always trust the file | ||
| 2861 | permissions), or a function of one argument which makes the decision. | ||
| 2862 | The argument is the directory name of the @file{RCS} subdirectory. A | ||
| 2863 | non-@code{nil} value from the function says to mistrust the file | ||
| 2864 | permissions. If you find that the file permissions of work files are | ||
| 2865 | changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. | ||
| 2866 | Then VC always checks the master file to determine the file's status. | ||
| 2867 | |||
| 2868 | VC determines the version control state of files under SCCS much as | ||
| 2869 | with RCS. It does not consider SCCS version headers, though. Thus, | ||
| 2870 | the variable @code{vc-mistrust-permissions} affects SCCS use, but | ||
| 2871 | @code{vc-consult-headers} does not. | ||
| 2872 | |||
| 2873 | @node CVS Options | ||
| 2874 | @subsubsection Options specific for CVS | ||
| 2875 | |||
| 2876 | @cindex locking (CVS) | ||
| 2877 | By default, CVS does not use locking to coordinate the activities of | ||
| 2878 | several users; anyone can change a work file at any time. However, | ||
| 2879 | there are ways to restrict this, resulting in behavior that resembles | ||
| 2880 | locking. | ||
| 2881 | |||
| 2882 | @cindex CVSREAD environment variable (CVS) | ||
| 2883 | For one thing, you can set the @env{CVSREAD} environment variable | ||
| 2884 | (the value you use makes no difference). If this variable is defined, | ||
| 2885 | CVS makes your work files read-only by default. In Emacs, you must | ||
| 2886 | type @kbd{C-x v v} to make the file writable, so that editing works | ||
| 2887 | in fact similar as if locking was used. Note however, that no actual | ||
| 2888 | locking is performed, so several users can make their files writable | ||
| 2889 | at the same time. When setting @env{CVSREAD} for the first time, make | ||
| 2890 | sure to check out all your modules anew, so that the file protections | ||
| 2891 | are set correctly. | ||
| 2892 | |||
| 2893 | @cindex cvs watch feature | ||
| 2894 | @cindex watching files (CVS) | ||
| 2895 | Another way to achieve something similar to locking is to use the | ||
| 2896 | @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | ||
| 2897 | read-only by default, and you must also use @kbd{C-x v v} in Emacs to | ||
| 2898 | make it writable. VC calls @code{cvs edit} to make the file writable, | ||
| 2899 | and CVS takes care to notify other developers of the fact that you | ||
| 2900 | intend to change the file. See the CVS documentation for details on | ||
| 2901 | using the watch feature. | ||
| 2902 | |||
| 2903 | @vindex vc-stay-local | ||
| 2904 | @vindex vc-cvs-stay-local | ||
| 2905 | @cindex remote repositories (CVS) | ||
| 2906 | When a file's repository is on a remote machine, VC tries to keep | ||
| 2907 | network interactions to a minimum. This is controlled by the variable | ||
| 2908 | @code{vc-cvs-stay-local}. There is another variable, | ||
| 2909 | @code{vc-stay-local}, which enables the feature also for other back | ||
| 2910 | ends that support it, including CVS. In the following, we will talk | ||
| 2911 | only about @code{vc-cvs-stay-local}, but everything applies to | ||
| 2912 | @code{vc-stay-local} as well. | ||
| 2913 | |||
| 2914 | If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses | ||
| 2915 | only the entry in the local CVS subdirectory to determine the file's | ||
| 2916 | state (and possibly information returned by previous CVS commands). | ||
| 2917 | One consequence of this is that when you have modified a file, and | ||
| 2918 | somebody else has already checked in other changes to the file, you | ||
| 2919 | are not notified of it until you actually try to commit. (But you can | ||
| 2920 | try to pick up any recent changes from the repository first, using | ||
| 2921 | @kbd{C-x v m @key{RET}}, @pxref{Merging}). | ||
| 2922 | |||
| 2923 | When @code{vc-cvs-stay-local} is @code{t}, VC also makes local | ||
| 2924 | version backups, so that simple diff and revert operations are | ||
| 2925 | completely local (@pxref{Version Backups}). | ||
| 2926 | |||
| 2927 | On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, | ||
| 2928 | then VC queries the remote repository @emph{before} it decides what to | ||
| 2929 | do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 2930 | repositories. It also does not make any version backups. | ||
| 2931 | |||
| 2932 | You can also set @code{vc-cvs-stay-local} to a regular expression | ||
| 2933 | that is matched against the repository host name; VC then stays local | ||
| 2934 | only for repositories from hosts that match the pattern. | ||
| 2935 | |||
| 2936 | @vindex vc-cvs-global-switches | ||
| 2937 | You can specify additional command line options to pass to all CVS | ||
| 2938 | operations in the variable @code{vc-cvs-global-switches}. These | ||
| 2939 | switches are inserted immediately after the @code{cvs} command, before | ||
| 2940 | the name of the operation to invoke. | ||
| 2941 | |||
| 2942 | @node Directories | 2085 | @node Directories |
| 2943 | @section File Directories | 2086 | @section File Directories |
| 2944 | 2087 | ||