(Commentary): Point to calendar.el.
[emacs.git] / doc / emacs / vc2-xtra.texi
blobbf7343bf91979137b46011721b6a8bb0f9dded2b
1 @c This is part of the Emacs manual.
2 @c Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
3 @c See file emacs.texi for copying conditions.
4 @c
5 @c This file is included either in vc-xtra.texi (when producing the
6 @c printed version) or in the main Emacs manual (for the on-line version).
7 @node Remote Repositories
8 @subsection Remote Repositories
9 @cindex remote repositories
11   A common way of using CVS and other more advanced VCSes is to set up
12 a central repository on some Internet host, then have each
13 developer check out a personal working copy of the files on his local
14 machine.  Committing changes to the repository, and picking up changes
15 from other users into one's own working area, then works by direct
16 interactions with the repository server.
18   One difficulty is that access to a repository server is often slow,
19 and that developers might need to work off-line as well.  While only
20 third-generation decentralized VCses such as GNU Arch or Mercurial
21 really solve this problem, VC is designed to reduce the amount of
22 network interaction necessary.
24   If you are using a truly decentralized VCS you can skip the rest of
25 this section. It describes backup and local-repository techniques
26 that are only useful for Subversion and earlier VCSes.
28 @menu
29 * Version Backups::        Keeping local copies of repository versions.
30 * Local Version Control::  Using another version system for local editing.
31 @end menu
33 @node Version Backups
34 @subsubsection Version Backups
35 @cindex version backups
37 @cindex automatic version backups
38   When VC sees that the repository for a file is on a remote
39 machine, it automatically makes local backups of unmodified versions
40 of the file---@dfn{automatic version backups}.  This means that you
41 can compare the file to the repository version (@kbd{C-x v =}), or
42 revert to that version (@kbd{C-x v u}), without any network
43 interactions.
45   The local copy of the unmodified file is called a @dfn{version
46 backup} to indicate that it corresponds exactly to a version that is
47 stored in the repository.  Note that version backups are not the same
48 as ordinary Emacs backup files
49 @iftex
50 (@pxref{Backup,,,emacs, the Emacs Manual}).
51 @end iftex
52 @ifnottex
53 (@pxref{Backup}).
54 @end ifnottex
55 But they follow a similar naming convention.
57   For a file that comes from a remote repository, VC makes a
58 version backup whenever you save the first changes to the file, and
59 removes it after you have committed your modified version to the
60 repository. You can disable the making of automatic version backups by
61 setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
63 @cindex manual version backups
64   The name of the automatic version backup for version @var{version}
65 of file @var{file} is @code{@var{file}.~@var{version}.~}.  This is
66 almost the same as the name used by @kbd{C-x v ~}
67 @iftex
68 (@pxref{Old Revisions,,,emacs, the Emacs Manual}),
69 @end iftex
70 @ifnottex
71 (@pxref{Old Revisions}),
72 @end ifnottex
73 the only difference being the additional dot (@samp{.})  after the
74 version number.  This similarity is intentional, because both kinds of
75 files store the same kind of information.  The file made by @kbd{C-x v
76 ~} acts as a @dfn{manual version backup}.
78   All the VC commands that operate on old versions of a file can use
79 both kinds of version backups.  For instance, @kbd{C-x v ~} uses
80 either an automatic or a manual version backup, if possible, to get
81 the contents of the version you request.  Likewise, @kbd{C-x v =} and
82 @kbd{C-x v u} use either an automatic or a manual version backup, if
83 one of them exists, to get the contents of a version to compare or
84 revert to.  If you changed a file outside of Emacs, so that no
85 automatic version backup was created for the previous text, you can
86 create a manual backup of that version using @kbd{C-x v ~}, and thus
87 obtain the benefit of the local copy for Emacs commands.
89   The only difference in Emacs's handling of manual and automatic
90 version backups, once they exist, is that Emacs deletes automatic
91 version backups when you commit to the repository.  By contrast,
92 manual version backups remain until you delete them.
94 @node Local Version Control
95 @subsubsection Local Version Control
96 @cindex local version control
97 @cindex local back end (version control)
99 When you make many changes to a file that comes from a remote
100 repository, it can be convenient to have version control on your local
101 machine as well.  You can then record intermediate versions, revert to
102 a previous state, etc., before you actually commit your changes to the
103 remote server.
105 VC lets you do this by putting a file under a second, local version
106 control system, so that the file is effectively registered in two
107 systems at the same time.  For the description here, we will assume
108 that the remote system is CVS, and you use RCS locally, although the
109 mechanism works with any combination of version control systems
110 (@dfn{back ends}).
112 To make it work with other back ends, you must make sure that the
113 ``more local'' back end comes before the ``more remote'' back end in
114 the setting of @code{vc-handled-backends} (@pxref{Customizing VC}).  By
115 default, this variable is set up so that you can use remote CVS and
116 local RCS as described here.
118 To start using local RCS for a file that comes from a remote CVS
119 server, you must @emph{register the file in RCS}, by typing @kbd{C-u
120 C-x v v rcs @key{RET}}.  (In other words, use @code{vc-next-action} with a
121 prefix argument, and specify RCS as the back end.)
123 You can do this at any time; it does not matter whether you have
124 already modified the file with respect to the version in the CVS
125 repository.  If possible, VC tries to make the RCS master start with
126 the unmodified repository version, then checks in any local changes
127 as a new version.  This works if you have not made any changes yet, or
128 if the unmodified repository version exists locally as a version
129 backup (@pxref{Version Backups}).  If the unmodified version is not
130 available locally, the RCS master starts with the modified version;
131 the only drawback to this is that you cannot compare your changes
132 locally to what is stored in the repository.
134 The version number of the RCS master is derived from the current CVS
135 version, starting a branch from it.  For example, if the current CVS
136 version is 1.23, the local RCS branch will be 1.23.1.  Version 1.23 in
137 the RCS master will be identical to version 1.23 under CVS; your first
138 changes are checked in as 1.23.1.1.  (If the unmodified file is not
139 available locally, VC will check in the modified file twice, both as
140 1.23 and 1.23.1.1, to make the revision numbers consistent.)
142 If you do not use locking under CVS (the default), locking is also
143 disabled for RCS, so that editing under RCS works exactly as under
144 CVS.
146 When you are done with local editing, you can commit the final version
147 back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
148 This initializes the log entry buffer
149 @iftex
150 (@pxref{Log Buffer,,,emacs, the Emacs Manual})
151 @end iftex
152 @ifnottex
153 (@pxref{Log Buffer})
154 @end ifnottex
155 to contain all the log entries you have recorded in the RCS master;
156 you can edit them as you wish, and then commit in CVS by typing
157 @kbd{C-c C-c}.  If the commit is successful, VC removes the RCS
158 master, so that the file is once again registered under CVS only.
159 (The RCS master is not actually deleted, just renamed by appending
160 @samp{~} to the name, so that you can refer to it later if you wish.)
162 While using local RCS, you can pick up recent changes from the CVS
163 repository into your local file, or commit some of your changes back
164 to CVS, without terminating local RCS version control.  To do this,
165 switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
167 @table @kbd
168 @item C-x v b
169 Switch to another back end that the current file is registered
170 under (@code{vc-switch-backend}).
172 @item C-u C-x v b @var{backend} @key{RET}
173 Switch to @var{backend} for the current file.
174 @end table
176 @kindex C-x v b
177 @findex vc-switch-backend
178 @kbd{C-x v b} does not change the buffer contents, or any files; it
179 only changes VC's perspective on how to handle the file.  Any
180 subsequent VC commands for that file will operate on the back end that
181 is currently selected.
183 If the current file is registered in more than one back end, typing
184 @kbd{C-x v b} ``cycles'' through all of these back ends.  With a
185 prefix argument, it asks for the back end to use in the minibuffer.
187 Thus, if you are using local RCS, and you want to pick up some recent
188 changes in the file from remote CVS, first visit the file, then type
189 @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
190 @key{RET}} to merge the news
191 @iftex
192 (@pxref{Merging,,,emacs, the Emacs Manual}).
193 @end iftex
194 @ifnottex
195 (@pxref{Merging}).
196 @end ifnottex
197 You can then switch back to RCS by typing @kbd{C-x v b} again, and
198 continue to edit locally.
200 But if you do this, the revision numbers in the RCS master no longer
201 correspond to those of CVS.  Technically, this is not a problem, but
202 it can become difficult to keep track of what is in the CVS repository
203 and what is not.  So we suggest that you return from time to time to
204 CVS-only operation, by committing your local changes back to the
205 repository using @kbd{C-u C-x v v cvs @key{RET}}.
207 @node Snapshots
208 @subsection Snapshots
209 @cindex snapshots and version control
211   A @dfn{snapshot} is a named set of file versions (one for each
212 registered file) that you can treat as a unit.  One important kind of
213 snapshot is a @dfn{release}, a (theoretically) stable version of the
214 system that is ready for distribution to users.
216 @menu
217 * Making Snapshots::            The snapshot facilities.
218 * Snapshot Caveats::            Things to be careful of when using snapshots.
219 @end menu
221 @node Making Snapshots
222 @subsubsection Making and Using Snapshots
224   There are two basic commands for snapshots; one makes a
225 snapshot with a given name, the other retrieves a named snapshot.
227 @table @code
228 @kindex C-x v s
229 @findex vc-create-snapshot
230 @item C-x v s @var{name} @key{RET}
231 Define the last saved versions of every registered file in or under the
232 current directory as a snapshot named @var{name}
233 (@code{vc-create-snapshot}).
235 @kindex C-x v r
236 @findex vc-retrieve-snapshot
237 @item C-x v r @var{name} @key{RET}
238 For all registered files at or below the current directory level, select
239 whatever versions correspond to the snapshot @var{name}
240 (@code{vc-retrieve-snapshot}).
242 This command reports an error if any files are locked at or below the
243 current directory, without changing anything; this is to avoid
244 overwriting work in progress.
245 @end table
247   A snapshot uses a very small amount of resources---just enough to record
248 the list of file names and which version belongs to the snapshot.  Thus,
249 you need not hesitate to create snapshots whenever they are useful.
251   You can give a snapshot name as an argument to @kbd{C-x v =} or
252 @kbd{C-x v ~}
253 @iftex
254 (@pxref{Old Revisions,,,emacs, the Emacs Manual}).
255 @end iftex
256 @ifnottex
257 (@pxref{Old Revisions}).
258 @end ifnottex
259 Thus, you can use it to compare a snapshot against the current files,
260 or two snapshots against each other, or a snapshot against a named
261 version.
263 @node Snapshot Caveats
264 @subsubsection Snapshot Caveats
266 @cindex named configurations (RCS)
267   VC's snapshot facilities are modeled on RCS's named-configuration
268 support.  They use RCS's native facilities for this, so
269 snapshots made using RCS through VC are visible even when you bypass VC.
271   With CVS, Meta-CVS, and Subversion, VC also uses the native
272 mechanism provided by that back end to make snapshots and retrieve them
273 (@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
275 @c worded verbosely to avoid overfull hbox.
276   For SCCS, VC implements snapshots itself.  The files it uses contain
277 name/file/version-number triples.  These snapshots are visible only
278 through VC.
280   There is no support for VC snapshots using GNU Arch yet.
282   A snapshot is a set of checked-in versions.  So make sure that all the
283 files are checked in and not locked when you make a snapshot.
285   File renaming and deletion can create some difficulties with snapshots.
286 This is not a VC-specific problem, but a general design issue in version
287 control systems that no one has solved very well yet.
289   If you rename a registered file, you need to rename its master along
290 with it (the command @code{vc-rename-file} does this automatically).  If
291 you are using SCCS, you must also update the records of the snapshot, to
292 mention the file by its new name (@code{vc-rename-file} does this,
293 too).  An old snapshot that refers to a master file that no longer
294 exists under the recorded name is invalid; VC can no longer retrieve
295 it.  It would be beyond the scope of this manual to explain enough about
296 RCS and SCCS to explain how to update the snapshots by hand.
298   Using @code{vc-rename-file} makes the snapshot remain valid for
299 retrieval, but it does not solve all problems.  For example, some of the
300 files in your program probably refer to others by name.  At the very
301 least, the makefile probably mentions the file that you renamed.  If you
302 retrieve an old snapshot, the renamed file is retrieved under its new
303 name, which is not the name that the makefile expects.  So the program
304 won't really work as retrieved.
306 @node Miscellaneous VC
307 @subsection Miscellaneous Commands and Features of VC
309   This section explains the less-frequently-used features of VC.
311 @menu
312 * Change Logs and VC::  Generating a change log file from log entries.
313 * Renaming and VC::     A command to rename both the source and master
314                           file correctly.
315 * Version Headers::     Inserting version control headers into working files.
316 @end menu
318 @node Change Logs and VC
319 @subsubsection Change Logs and VC
321   If you use RCS or CVS for a program and also maintain a change log
322 file for it
323 @iftex
324 (@pxref{Change Log,,,emacs, the Emacs Manual}),
325 @end iftex
326 @ifnottex
327 (@pxref{Change Log}),
328 @end ifnottex
329 you can generate change log entries automatically from the version
330 control log entries:
332 @table @kbd
333 @item C-x v a
334 @kindex C-x v a
335 @findex vc-update-change-log
336 Visit the current directory's change log file and, for registered files
337 in that directory, create new entries for versions checked in since the
338 most recent entry in the change log file.
339 (@code{vc-update-change-log}).
341 This command works with RCS or CVS only, not with any of the other
342 back ends.
344 @item C-u C-x v a
345 As above, but only find entries for the current buffer's file.
347 @item M-1 C-x v a
348 As above, but find entries for all the currently visited files that are
349 maintained with version control.  This works only with RCS, and it puts
350 all entries in the log for the default directory, which may not be
351 appropriate.
352 @end table
354   For example, suppose the first line of @file{ChangeLog} is dated
355 1999-04-10, and that the only check-in since then was by Nathaniel
356 Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
357 messages that start with `#'.}.  Then @kbd{C-x v a} visits
358 @file{ChangeLog} and inserts text like this:
360 @iftex
361 @medbreak
362 @end iftex
363 @smallexample
364 @group
365 1999-05-22  Nathaniel Bowditch  <nat@@apn.org>
367         * rcs2log: Ignore log messages that start with `#'.
368 @end group
369 @end smallexample
370 @iftex
371 @medbreak
372 @end iftex
374 @noindent
375 You can then edit the new change log entry further as you wish.
377   Some of the new change log entries may duplicate what's already in
378 ChangeLog.  You will have to remove these duplicates by hand.
380   Normally, the log entry for file @file{foo} is displayed as @samp{*
381 foo: @var{text of log entry}}.  The @samp{:} after @file{foo} is omitted
382 if the text of the log entry starts with @w{@samp{(@var{functionname}):
383 }}.  For example, if the log entry for @file{vc.el} is
384 @samp{(vc-do-command): Check call-process status.}, then the text in
385 @file{ChangeLog} looks like this:
387 @iftex
388 @medbreak
389 @end iftex
390 @smallexample
391 @group
392 1999-05-06  Nathaniel Bowditch  <nat@@apn.org>
394         * vc.el (vc-do-command): Check call-process status.
395 @end group
396 @end smallexample
397 @iftex
398 @medbreak
399 @end iftex
401   When @kbd{C-x v a} adds several change log entries at once, it groups
402 related log entries together if they all are checked in by the same
403 author at nearly the same time.  If the log entries for several such
404 files all have the same text, it coalesces them into a single entry.
405 For example, suppose the most recent check-ins have the following log
406 entries:
408 @flushleft
409 @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
410 @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
411 @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
412 @end flushleft
414 @noindent
415 They appear like this in @file{ChangeLog}:
417 @iftex
418 @medbreak
419 @end iftex
420 @smallexample
421 @group
422 1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
424         * vc.texinfo: Fix expansion typos.
426         * vc.el, vc-hooks.el: Don't call expand-file-name.
427 @end group
428 @end smallexample
429 @iftex
430 @medbreak
431 @end iftex
433   Normally, @kbd{C-x v a} separates log entries by a blank line, but you
434 can mark several related log entries to be clumped together (without an
435 intervening blank line) by starting the text of each related log entry
436 with a label of the form @w{@samp{@{@var{clumpname}@} }}.  The label
437 itself is not copied to @file{ChangeLog}.  For example, suppose the log
438 entries are:
440 @flushleft
441 @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
442 @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
443 @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
444 @end flushleft
446 @noindent
447 Then the text in @file{ChangeLog} looks like this:
449 @iftex
450 @medbreak
451 @end iftex
452 @smallexample
453 @group
454 1999-04-01  Nathaniel Bowditch  <nat@@apn.org>
456         * vc.texinfo: Fix expansion typos.
457         * vc.el, vc-hooks.el: Don't call expand-file-name.
458 @end group
459 @end smallexample
460 @iftex
461 @medbreak
462 @end iftex
464   A log entry whose text begins with @samp{#} is not copied to
465 @file{ChangeLog}.  For example, if you merely fix some misspellings in
466 comments, you can log the change with an entry beginning with @samp{#}
467 to avoid putting such trivia into @file{ChangeLog}.
469 @node Renaming and VC
470 @subsubsection Renaming VC Work Files and Master Files
472 @findex vc-rename-file
473   When you rename a registered file, you must also rename its master
474 file correspondingly to get proper results.  Use @code{vc-rename-file}
475 to rename the source file as you specify, and rename its master file
476 accordingly.  It also updates any snapshots (@pxref{Snapshots}) that
477 mention the file, so that they use the new name; despite this, the
478 snapshot thus modified may not completely work (@pxref{Snapshot
479 Caveats}).
481   Some back ends do not provide an explicit rename operation to their
482 repositories.  After issuing @code{vc-rename-file}, use @kbd{C-x v v}
483 on the original and renamed buffers and provide the necessary edit
484 log.
486   You cannot use @code{vc-rename-file} on a file that is locked by
487 someone else.
489 @node Version Headers
490 @subsubsection Inserting Version Control Headers
492    Sometimes it is convenient to put version identification strings
493 directly into working files.  Certain special strings called
494 @dfn{version headers} are replaced in each successive version by the
495 number of that version, the name of the user who created it, and other
496 relevant information.  All of the back ends that VC supports have such
497 a mechanism, except GNU Arch.
499   VC does not normally use the information contained in these headers.
500 The exception is RCS---with RCS, version headers are sometimes more
501 reliable than the master file to determine which version of the file
502 you are editing.  Note that in a multi-branch environment, version
503 headers are necessary to make VC behave correctly
504 @iftex
505 (@pxref{Multi-User Branching,,,emacs, the Emacs Manual}).
506 @end iftex
507 @ifnottex
508 (@pxref{Multi-User Branching}).
509 @end ifnottex
511   Searching for RCS version headers is controlled by the variable
512 @code{vc-consult-headers}.  If it is non-@code{nil} (the default),
513 Emacs searches for headers to determine the version number you are
514 editing.  Setting it to @code{nil} disables this feature.
516   Note that although CVS uses the same kind of version headers as RCS
517 does, VC never searches for these headers if you are using CVS,
518 regardless of the above setting.
520 @kindex C-x v h
521 @findex vc-insert-headers
522   You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
523 insert a suitable header string.
525 @table @kbd
526 @item C-x v h
527 Insert headers in a file for use with your version-control system.
528 @end table
530 @vindex vc-@var{backend}-header
531   The default header string is @samp{@w{$}Id$} for RCS and
532 @samp{@w{%}W%} for SCCS.  You can specify other headers to insert by
533 setting the variables @code{vc-@var{backend}-header} where
534 @var{backend} is @code{rcs} or @code{sccs}.
536   Instead of a single string, you can specify a list of strings; then
537 each string in the list is inserted as a separate header on a line of
538 its own.
540   It may be necessary to use apparently-superfluous backslashes when
541 writing the strings that you put in this variable.  For instance, you
542 might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}.  The extra
543 backslash prevents the string constant from being interpreted as a
544 header, if the Emacs Lisp file containing it is maintained with
545 version control.
547 @vindex vc-comment-alist
548   Each header is inserted surrounded by tabs, inside comment delimiters,
549 on a new line at point.  Normally the ordinary comment
550 start and comment end strings of the current mode are used, but for
551 certain modes, there are special comment delimiters for this purpose;
552 the variable @code{vc-comment-alist} specifies them.  Each element of
553 this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
555 @vindex vc-static-header-alist
556   The variable @code{vc-static-header-alist} specifies further strings
557 to add based on the name of the buffer.  Its value should be a list of
558 elements of the form @code{(@var{regexp} . @var{format})}.  Whenever
559 @var{regexp} matches the buffer name, @var{format} is inserted as part
560 of the header.  A header line is inserted for each element that matches
561 the buffer name, and for each string specified by
562 @code{vc-@var{backend}-header}.  The header line is made by processing the
563 string from @code{vc-@var{backend}-header} with the format taken from the
564 element.  The default value for @code{vc-static-header-alist} is as follows:
566 @example
567 @group
568 (("\\.c$" .
569   "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
570 #endif /* lint */\n"))
571 @end group
572 @end example
574 @noindent
575 It specifies insertion of text of this form:
577 @example
578 @group
580 #ifndef lint
581 static char vcid[] = "@var{string}";
582 #endif /* lint */
583 @end group
584 @end example
586 @noindent
587 Note that the text above starts with a blank line.
589   If you use more than one version header in a file, put them close
590 together in the file.  The mechanism in @code{revert-buffer} that
591 preserves markers may not handle markers positioned between two version
592 headers.
594 @node Customizing VC
595 @subsection Customizing VC
597 @vindex vc-handled-backends
598 The variable @code{vc-handled-backends} determines which version
599 control systems VC should handle.  The default value is @code{(RCS CVS
600 SVN SCCS BZR GIT HG Arch MCVS)}, so it contains all the version systems
601 that are currently supported.  If you want VC to ignore one or more of
602 these systems, exclude its name from the list.  To disable VC entirely,
603 set this variable to @code{nil}.
605 The order of systems in the list is significant: when you visit a file
606 registered in more than one system (@pxref{Local Version Control}), VC
607 uses the system that comes first in @code{vc-handled-backends} by
608 default.  The order is also significant when you register a file for
609 the first time, see
610 @iftex
611 @ref{Registering,,,emacs, the Emacs Manual},
612 @end iftex
613 @ifnottex
614 @ref{Registering},
615 @end ifnottex
616 for details.
618 @menu
619 * General VC Options::  Options that apply to multiple back ends.
620 * RCS and SCCS::        Options for RCS and SCCS.
621 * CVS Options::         Options for CVS.
622 @end menu
624 @node General VC Options
625 @subsubsection General Options
627 @vindex vc-make-backup-files
628   Emacs normally does not save backup files for source files that are
629 maintained with version control.  If you want to make backup files even
630 for files that use version control, set the variable
631 @code{vc-make-backup-files} to a non-@code{nil} value.
633 @vindex vc-keep-workfiles
634   Normally the work file exists all the time, whether it is locked or
635 not.  If you set @code{vc-keep-workfiles} to @code{nil}, then checking
636 in a new version with @kbd{C-x v v} deletes the work file; but any
637 attempt to visit the file with Emacs creates it again.  (With CVS, work
638 files are always kept.)
640 @vindex vc-follow-symlinks
641   Editing a version-controlled file through a symbolic link can be
642 dangerous.  It bypasses the version control system---you can edit the
643 file without locking it, and fail to check your changes in.  Also,
644 your changes might overwrite those of another user.  To protect against
645 this, VC checks each symbolic link that you visit, to see if it points
646 to a file under version control.
648   The variable @code{vc-follow-symlinks} controls what to do when a
649 symbolic link points to a version-controlled file.  If it is @code{nil},
650 VC only displays a warning message.  If it is @code{t}, VC automatically
651 follows the link, and visits the real file instead, telling you about
652 this in the echo area.  If the value is @code{ask} (the default), VC
653 asks you each time whether to follow the link.
655 @vindex vc-suppress-confirm
656   If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
657 and @kbd{C-x v i} can save the current buffer without asking, and
658 @kbd{C-x v u} also operates without asking for confirmation.  (This
659 variable does not affect @kbd{C-x v c}; that operation is so drastic
660 that it should always ask for confirmation.)
662 @vindex vc-command-messages
663   VC mode does much of its work by running the shell commands for RCS,
664 CVS and SCCS.  If @code{vc-command-messages} is non-@code{nil}, VC
665 displays messages to indicate which shell commands it runs, and
666 additional messages when the commands finish.
668 @vindex vc-path
669   You can specify additional directories to search for version control
670 programs by setting the variable @code{vc-path}.  These directories
671 are searched before the usual search path.  It is rarely necessary to
672 set this variable, because VC normally finds the proper files
673 automatically.
675 @node RCS and SCCS
676 @subsubsection Options for RCS and SCCS
678 @cindex non-strict locking (RCS)
679 @cindex locking, non-strict (RCS)
680   By default, RCS uses locking to coordinate the activities of several
681 users, but there is a mode called @dfn{non-strict locking} in which
682 you can check-in changes without locking the file first.  Use
683 @samp{rcs -U} to switch to non-strict locking for a particular file,
684 see the @code{rcs} manual page for details.
686   When deducing the version control state of an RCS file, VC first
687 looks for an RCS version header string in the file (@pxref{Version
688 Headers}).  If there is no header string, VC normally looks at the
689 file permissions of the work file; this is fast.  But there might be
690 situations when the file permissions cannot be trusted.  In this case
691 the master file has to be consulted, which is rather expensive.  Also
692 the master file can only tell you @emph{if} there's any lock on the
693 file, but not whether your work file really contains that locked
694 version.
696 @vindex vc-consult-headers
697   You can tell VC not to use version headers to determine the file
698 status by setting @code{vc-consult-headers} to @code{nil}.  VC then
699 always uses the file permissions (if it is supposed to trust them), or
700 else checks the master file.
702 @vindex vc-mistrust-permissions
703   You can specify the criterion for whether to trust the file
704 permissions by setting the variable @code{vc-mistrust-permissions}.
705 Its value can be @code{t} (always mistrust the file permissions and
706 check the master file), @code{nil} (always trust the file
707 permissions), or a function of one argument which makes the decision.
708 The argument is the directory name of the @file{RCS} subdirectory.  A
709 non-@code{nil} value from the function says to mistrust the file
710 permissions.  If you find that the file permissions of work files are
711 changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
712 Then VC always checks the master file to determine the file's status.
714   VC determines the version control state of files under SCCS much as
715 with RCS.  It does not consider SCCS version headers, though.  Thus,
716 the variable @code{vc-mistrust-permissions} affects SCCS use, but
717 @code{vc-consult-headers} does not.
719 @node CVS Options
720 @subsubsection Options specific for CVS
722 @cindex locking (CVS)
723   By default, CVS does not use locking to coordinate the activities of
724 several users; anyone can change a work file at any time.  However,
725 there are ways to restrict this, resulting in behavior that resembles
726 locking.
728 @cindex CVSREAD environment variable (CVS)
729   For one thing, you can set the @env{CVSREAD} environment variable
730 (the value you use makes no difference).  If this variable is defined,
731 CVS makes your work files read-only by default.  In Emacs, you must
732 type @kbd{C-x v v} to make the file writable, so that editing works
733 in fact similar as if locking was used.  Note however, that no actual
734 locking is performed, so several users can make their files writable
735 at the same time.  When setting @env{CVSREAD} for the first time, make
736 sure to check out all your modules anew, so that the file protections
737 are set correctly.
739 @cindex cvs watch feature
740 @cindex watching files (CVS)
741   Another way to achieve something similar to locking is to use the
742 @dfn{watch} feature of CVS.  If a file is being watched, CVS makes it
743 read-only by default, and you must also use @kbd{C-x v v} in Emacs to
744 make it writable.  VC calls @code{cvs edit} to make the file writable,
745 and CVS takes care to notify other developers of the fact that you
746 intend to change the file.  See the CVS documentation for details on
747 using the watch feature.
749 @vindex vc-stay-local
750 @vindex vc-cvs-stay-local
751 @cindex remote repositories (CVS)
752   When a file's repository is on a remote machine, VC tries to keep
753 network interactions to a minimum.  This is controlled by the variable
754 @code{vc-cvs-stay-local}.  There is another variable,
755 @code{vc-stay-local}, which enables the feature also for other back
756 ends that support it, including CVS.  In the following, we will talk
757 only about @code{vc-cvs-stay-local}, but everything applies to
758 @code{vc-stay-local} as well.
760 If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
761 only the entry in the local CVS subdirectory to determine the file's
762 state (and possibly information returned by previous CVS commands).
763 One consequence of this is that when you have modified a file, and
764 somebody else has already checked in other changes to the file, you
765 are not notified of it until you actually try to commit.  (But you can
766 try to pick up any recent changes from the repository first, using
767 @kbd{C-x v m @key{RET}},
768 @iftex
769 @pxref{Merging,,,emacs, the Emacs Manual}).
770 @end iftex
771 @ifnottex
772 @pxref{Merging}).
773 @end ifnottex
775   When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
776 version backups, so that simple diff and revert operations are
777 completely local (@pxref{Version Backups}).
779   On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
780 then VC queries the remote repository @emph{before} it decides what to
781 do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
782 repositories.  It also does not make any version backups.
784   You can also set @code{vc-cvs-stay-local} to a regular expression
785 that is matched against the repository host name; VC then stays local
786 only for repositories from hosts that match the pattern.
788 @vindex vc-cvs-global-switches
789   You can specify additional command line options to pass to all CVS
790 operations in the variable @code{vc-cvs-global-switches}.  These
791 switches are inserted immediately after the @code{cvs} command, before
792 the name of the operation to invoke.
794 @ignore
795    arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e
796 @end ignore