Terminology cleanup.
[bpt/emacs.git] / doc / emacs / vc1-xtra.texi
CommitLineData
8cf51b2c
GM
1@c This is part of the Emacs manual.
2@c Copyright (C) 2004, 2005, 2006, 2007 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 VC Dired Mode
8@subsection Dired under VC
9
10@cindex PCL-CVS
11@pindex cvs
12@cindex CVS Dired Mode
13 The VC Dired Mode described here works with all the version control
14systems that VC supports. Another more powerful facility, designed
15specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
16pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
17
18@kindex C-x v d
19@findex vc-directory
20 When you are working on a large program, it is often useful to find
21out which files have changed within an entire directory tree, or to view
22the status of all files under version control at once, and to perform
23version control operations on collections of files. You can use the
24command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
25that includes only files relevant for version control.
26
27@vindex vc-dired-terse-display
28 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
29much like an ordinary Dired buffer
30@iftex
31(@pxref{Dired,,,emacs, the Emacs Manual});
32@end iftex
33@ifnottex
34(@pxref{Dired});
35@end ifnottex
36however, normally it shows only the noteworthy files (those locked or
37not up-to-date). This is called @dfn{terse display}. If you set the
38variable @code{vc-dired-terse-display} to @code{nil}, then VC Dired
39shows all relevant files---those managed under version control, plus
40all subdirectories (@dfn{full display}). The command @kbd{v t} in a
41VC Dired buffer toggles between terse display and full display
42(@pxref{VC Dired Commands}).
43
44@vindex vc-dired-recurse
45 By default, VC Dired produces a recursive listing of noteworthy or
46relevant files at or below the given directory. You can change this by
47setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
48Dired shows only the files in the given directory.
49
50 The line for an individual file shows the version control state in the
51place of the hard link count, owner, group, and size of the file. If
52the file is unmodified, in sync with the master file, the version
53control state shown is blank. Otherwise it consists of text in
54parentheses. Under RCS and SCCS, the name of the user locking the file
55is shown; under CVS, an abbreviated version of the @samp{cvs status}
56output is used. Here is an example using RCS:
57
58@smallexample
59@group
60 /home/jim/project:
61
62 -rw-r--r-- (jim) Apr 2 23:39 file1
63 -r--r--r-- Apr 5 20:21 file2
64@end group
65@end smallexample
66
67@noindent
68The files @samp{file1} and @samp{file2} are under version control,
69@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
70
71 Here is an example using CVS:
72
73@smallexample
74@group
75 /home/joe/develop:
76
77 -rw-r--r-- (modified) Aug 2 1997 file1.c
78 -rw-r--r-- Apr 4 20:09 file2.c
79 -rw-r--r-- (merge) Sep 13 1996 file3.c
80@end group
81@end smallexample
82
83 Here @samp{file1.c} is modified with respect to the repository, and
84@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
85have also been checked in to the repository---you need to merge them
86with the work file before you can check it in.
87
88@vindex vc-stay-local
89@vindex vc-cvs-stay-local
90 In the above, if the repository were on a remote machine, VC would
91only contact it when the variable @code{vc-stay-local} (or
92@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
93because access to the repository may be slow, or you may be working
94offline and not have access to the repository at all. As a
95consequence, VC would not be able to tell you that @samp{file3.c} is
96in the ``merge'' state; you would learn that only when you try to
97check-in your modified copy of the file, or use a command such as
98@kbd{C-x v m}.
99
100 In practice, this is not a problem because CVS handles this case
101consistently whenever it arises. In VC, you'll simply get prompted to
102merge the remote changes into your work file first. The benefits of
103less network communication usually outweigh the disadvantage of not
104seeing remote changes immediately.
105
106@vindex vc-directory-exclusion-list
107 When VC Dired displays subdirectories (in the ``full'' display mode),
108it omits some that should never contain any files under version control.
109By default, this includes Version Control subdirectories such as
110@samp{RCS} and @samp{CVS}; you can customize this by setting the
111variable @code{vc-directory-exclusion-list}.
112
113 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
114ordinary Dired, that allows you to specify additional switches for the
115@samp{ls} command.
116
117@node VC Dired Commands
118@subsection VC Dired Commands
119
120 All the usual Dired commands work normally in VC Dired mode, except
121for @kbd{v}, which is redefined as the version control prefix. You can
122invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
0870a421
ER
123typing @kbd{v =}, or @kbd{v l}, and so on. These commands will apply
124to the set of files you have marked for operation in the VC-Dired
125buffer.
8cf51b2c
GM
126
127 The command @kbd{v v} (@code{vc-next-action}) operates on all the
128marked files, so that you can lock or check in several files at once.
0870a421
ER
129If the underlying VC supports atomic commits of multiple-file
130changesets @kbd{v v} with a selected set of modified but not committed
131files wuill commit all of them at once as a single changeset.
132
133 When @kbd{v v} (@code{vc-next-action}) operates on a set of files,
134it requires that all of those files must be in the same state;
135otherwise it will throw an error. Note that this differs from the
136behavior of older versions of VC, which did not have fileset
137operations and simply did @code{vc-next-action} on each file
138individually.
139
140 If any files are in a state that calls for commit, @kbd{v v} reads a
141single log entry and uses it for the changeset as a whole. If the
142underling VCS is file- rather than changeset-oriented, the log entry
143will be replicated into the history of each file.
8cf51b2c
GM
144
145@findex vc-dired-toggle-terse-mode
146@findex vc-dired-mark-locked
147 You can toggle between terse display (only locked files, or files not
148up-to-date) and full display at any time by typing @kbd{v t}
149(@code{vc-dired-toggle-terse-mode}). There is also a special command
150@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
151locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
152t k} is another way to delete from the buffer all files except those
153currently locked.
154
155@ignore
156 arch-tag: 8e8c2a01-ad41-4e61-a89a-60131ad67263
157@end ignore