diff options
| author | Chong Yidong | 2008-10-21 20:50:54 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-10-21 20:50:54 +0000 |
| commit | 3e6be0e86e98806cc5118d5b12f07cfc1aeb07e7 (patch) | |
| tree | 9a8c7e669263dc4452ad12341a103a1279a2475f | |
| parent | 24216908af1570926bf14016d37c13e65642dc0a (diff) | |
| download | emacs-3e6be0e86e98806cc5118d5b12f07cfc1aeb07e7.tar.gz emacs-3e6be0e86e98806cc5118d5b12f07cfc1aeb07e7.zip | |
(Visiting): Document find-file-confirm-nonexistent-file.
(Version Control): Add VC Directory Mode and VC Directory Commands to
the submenu.
(Why Version Control?): Use table format.
(Version Control Systems): Note that Meta-CVS support is gone.
(VCS Concepts): Note precisely when VC started supporting filesets.
Remove bogus xref to CVS Options node.
(Types of Log File): Copyedits.
(VC Mode Line): Document tooltips and mouse-1 on VC indicator.
(Basic VC Editing): Content moved from Selecting A Fileset and Doing
The Right Thing.
(Selecting A Fileset, Doing The Right Thing): Nodes deleted.
(Log Buffer): Reorganize node, putting C-c C-c description first.
(Old Revisions): Use CVS for example, not RCS.
(Secondary VC Commands): Remove VC Directory Mode and VC Directory
Commands from the submenu, putting them under Version Control.
(VC Directory Mode): Move node contents here from vc1-xtra.texi; we
need to include it in the manual unconditionally, since it is now
crucial to using distributed version control systems.
| -rw-r--r-- | doc/emacs/files.texi | 913 |
1 files changed, 523 insertions, 390 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 17132ac2050..45d3d4a6e28 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -241,10 +241,14 @@ moves or copies the file into the displayed directory. For details, | |||
| 241 | see @ref{Drag and Drop}, and @ref{Misc Dired Features}. | 241 | see @ref{Drag and Drop}, and @ref{Misc Dired Features}. |
| 242 | 242 | ||
| 243 | @cindex creating files | 243 | @cindex creating files |
| 244 | @vindex find-file-confirm-nonexistent-file | ||
| 244 | What if you want to create a new file? Just visit it. Emacs | 245 | What if you want to create a new file? Just visit it. Emacs |
| 245 | displays @samp{(New file)} in the echo area, but in other respects | 246 | displays @samp{(New file)} in the echo area, but in other respects |
| 246 | behaves as if you had visited an existing empty file. If you make | 247 | behaves as if you had visited an existing empty file. If you make |
| 247 | changes and save them, the file is created. | 248 | changes and save them, the file is created. If you change the |
| 249 | variable @code{find-file-confirm-nonexistent-file} to @code{t}, then | ||
| 250 | Emacs prompts you for confirmation before visiting a non-existent | ||
| 251 | file. | ||
| 248 | 252 | ||
| 249 | @kindex C-x C-v | 253 | @kindex C-x C-v |
| 250 | @findex find-alternate-file | 254 | @findex find-alternate-file |
| @@ -1169,8 +1173,8 @@ time of each version, who created it, and a description of what was | |||
| 1169 | changed in that version. | 1173 | changed in that version. |
| 1170 | 1174 | ||
| 1171 | The Emacs version control interface is called VC. Its commands work | 1175 | The Emacs version control interface is called VC. Its commands work |
| 1172 | with different version control systems; currently, it supports GNU | 1176 | with several different version control systems; currently, it supports |
| 1173 | Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS, and | 1177 | GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and |
| 1174 | Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS, | 1178 | Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS, |
| 1175 | and Bazaar. | 1179 | and Bazaar. |
| 1176 | 1180 | ||
| @@ -1191,6 +1195,7 @@ customizable variable @code{vc-handled-backends} to @code{nil} | |||
| 1191 | * Basic VC Editing:: How to edit a file under version control. | 1195 | * Basic VC Editing:: How to edit a file under version control. |
| 1192 | * Old Revisions:: Examining and comparing old versions. | 1196 | * Old Revisions:: Examining and comparing old versions. |
| 1193 | * Secondary VC Commands:: The commands used a little less frequently. | 1197 | * Secondary VC Commands:: The commands used a little less frequently. |
| 1198 | * VC Directory Mode:: Listing files managed by version control. | ||
| 1194 | * Branches:: Multiple lines of development. | 1199 | * Branches:: Multiple lines of development. |
| 1195 | @ifnottex | 1200 | @ifnottex |
| 1196 | * Remote Repositories:: Efficient access to remote CVS servers. | 1201 | * Remote Repositories:: Efficient access to remote CVS servers. |
| @@ -1205,10 +1210,10 @@ customizable variable @code{vc-handled-backends} to @code{nil} | |||
| 1205 | 1210 | ||
| 1206 | VC allows you to use a version control system from within Emacs, | 1211 | VC allows you to use a version control system from within Emacs, |
| 1207 | integrating the version control operations smoothly with editing. | 1212 | integrating the version control operations smoothly with editing. |
| 1208 | Though VC cannot completely bridge the gaps between version-control | 1213 | Though VC cannot completely bridge the gaps between version control |
| 1209 | systems with widely differing capabilities, it does provide | 1214 | systems with widely differing capabilities, it does provide a uniform |
| 1210 | a uniform interface to many version control operations. Regardless of | 1215 | interface to many version control operations. Regardless of which |
| 1211 | which version control system is in use, you will be able to do basic | 1216 | version control system is in use, you will be able to do basic |
| 1212 | operations in much the same way. | 1217 | operations in much the same way. |
| 1213 | 1218 | ||
| 1214 | This section provides a general overview of version control, and | 1219 | This section provides a general overview of version control, and |
| @@ -1226,22 +1231,26 @@ you want to use. | |||
| 1226 | @node Why Version Control? | 1231 | @node Why Version Control? |
| 1227 | @subsubsection Understanding the problems it addresses | 1232 | @subsubsection Understanding the problems it addresses |
| 1228 | 1233 | ||
| 1229 | Version control systems provide you with three important capabilities: | 1234 | Version control systems provide you with three important |
| 1230 | @dfn{reversibility}, @dfn{concurrency}, and @dfn{history}. | 1235 | capabilities: |
| 1231 | 1236 | ||
| 1232 | The most basic capability you get from a version-control system is | 1237 | @itemize @bullet |
| 1233 | reversibility, the ability to back up to a saved, known-good state when | 1238 | @item |
| 1234 | you discover that some modification you did was a mistake or a bad idea. | 1239 | @dfn{Reversibility}: the ability to back up to a previous state if you |
| 1240 | discover that some modification you did was a mistake or a bad idea. | ||
| 1235 | 1241 | ||
| 1236 | Version control systems also support concurrency: the ability to | 1242 | @item |
| 1237 | have many people modifying the same collection of code or documents | 1243 | @dfn{Concurrency}: the ability to have many people modifying the same |
| 1238 | knowing that conflicting modifications can be detected and resolved. | 1244 | collection of files knowing that conflicting modifications can be |
| 1245 | detected and resolved. | ||
| 1239 | 1246 | ||
| 1240 | Version control systems give you the capability to attach a history | 1247 | @item |
| 1241 | to your data, such as explanatory comments about the intention behind | 1248 | @dfn{History}: the ability to attach historical data to your data, |
| 1242 | each change to it. Even for a programmer working solo, change | 1249 | such as explanatory comments about the intention behind each change to |
| 1243 | histories are an important aid to memory; for a multi-person project, | 1250 | it. Even for a programmer working solo, change histories are an |
| 1244 | they are a vitally important form of communication among developers. | 1251 | important aid to memory; for a multi-person project, they are a |
| 1252 | vitally important form of communication among developers. | ||
| 1253 | @end itemize | ||
| 1245 | 1254 | ||
| 1246 | @node Version Control Systems | 1255 | @node Version Control Systems |
| 1247 | @subsubsection Supported Version Control Systems | 1256 | @subsubsection Supported Version Control Systems |
| @@ -1249,26 +1258,22 @@ they are a vitally important form of communication among developers. | |||
| 1249 | @cindex back end (version control) | 1258 | @cindex back end (version control) |
| 1250 | VC currently works with many different version control systems or | 1259 | VC currently works with many different version control systems or |
| 1251 | @dfn{back ends}: | 1260 | @dfn{back ends}: |
| 1252 | @comment Omitting bzr because support is very scratchy and incomplete. | ||
| 1253 | |||
| 1254 | 1261 | ||
| 1255 | @itemize @bullet | 1262 | @itemize @bullet |
| 1256 | 1263 | ||
| 1257 | @cindex SCCS | 1264 | @cindex SCCS |
| 1258 | @item | 1265 | @item |
| 1259 | SCCS was the first version control system ever built, and was long ago | 1266 | SCCS was the first version control system ever built, and was long ago |
| 1260 | superseded by later and more advanced ones; Emacs supports it only for | 1267 | superseded by more advanced ones. VC compensates for certain features |
| 1261 | backward compatibility and historical reasons. VC compensates for | 1268 | missing in SCCS (e.g., tag names for releases) by implementing them |
| 1262 | certain features missing in SCCS (e.g., tag names for releases) by | 1269 | itself. Other VC features, such as multiple branches, are simply |
| 1263 | implementing them itself. Other VC features, such as multiple | 1270 | unavailable. Since SCCS is non-free, we recommend avoiding it. |
| 1264 | branches, are simply unavailable. Since SCCS is non-free, we | ||
| 1265 | recommend avoiding it. | ||
| 1266 | 1271 | ||
| 1267 | @cindex CSSC | 1272 | @cindex CSSC |
| 1268 | @item | 1273 | @item |
| 1269 | CSSC is a free replacement for SCCS. You should use CSSC only if, for | 1274 | CSSC is a free replacement for SCCS. You should use CSSC only if, for |
| 1270 | some reason, you cannot use a more recent and better-designed | 1275 | some reason, you cannot use a more recent and better-designed version |
| 1271 | version-control system. | 1276 | control system. |
| 1272 | 1277 | ||
| 1273 | @cindex RCS | 1278 | @cindex RCS |
| 1274 | @item | 1279 | @item |
| @@ -1280,8 +1285,8 @@ level of individual files rather than projects. | |||
| 1280 | @cindex CVS | 1285 | @cindex CVS |
| 1281 | @item | 1286 | @item |
| 1282 | CVS is the free version control system that was, until recently (circa | 1287 | CVS is the free version control system that was, until recently (circa |
| 1283 | 2008), used for the majority of free software projects. Nowadays, it | 1288 | 2008), used by the majority of free software projects. Nowadays, it |
| 1284 | is slowly being superseded by other systems. CVS allows concurrent | 1289 | is slowly being superseded by newer systems. CVS allows concurrent |
| 1285 | multi-user development either locally or over the network. It lacks | 1290 | multi-user development either locally or over the network. It lacks |
| 1286 | support for atomic commits or file moving/renaming. VC supports all | 1291 | support for atomic commits or file moving/renaming. VC supports all |
| 1287 | basic editing operations under CVS. For some less common tasks, you | 1292 | basic editing operations under CVS. For some less common tasks, you |
| @@ -1337,6 +1342,10 @@ commits and file moving/renaming. VC supports most basic editing | |||
| 1337 | operations under Bazaar. | 1342 | operations under Bazaar. |
| 1338 | @end itemize | 1343 | @end itemize |
| 1339 | 1344 | ||
| 1345 | Previous versions of VC supported a version control system known as | ||
| 1346 | Meta-CVS. This support has been dropped because of limited interest | ||
| 1347 | from users and developers. | ||
| 1348 | |||
| 1340 | @node VCS Concepts | 1349 | @node VCS Concepts |
| 1341 | @subsubsection Concepts of Version Control | 1350 | @subsubsection Concepts of Version Control |
| 1342 | 1351 | ||
| @@ -1366,93 +1375,91 @@ on the version control system; in the simplest case, it is just an | |||
| 1366 | integer. | 1375 | integer. |
| 1367 | 1376 | ||
| 1368 | To go beyond these basic concepts, you will need to understand three | 1377 | To go beyond these basic concepts, you will need to understand three |
| 1369 | ways in which version-control systems can differ from each other. They | 1378 | ways in which version control systems can differ from each other. |
| 1370 | can be locking or merging; they can be file-based or changeset-based; | 1379 | They can be locking-based or merging-based; they can be file-based or |
| 1371 | and they can be centralized or decentralized. VC handles all these | 1380 | changeset-based; and they can be centralized or decentralized. VC |
| 1372 | choices, but they lead to differing behaviors which you will need | 1381 | handles all these choices, but they lead to differing behaviors which |
| 1373 | to understand as you use it. | 1382 | you will need to understand as you use it. |
| 1374 | 1383 | ||
| 1375 | @cindex locking versus merging | 1384 | @cindex locking versus merging |
| 1376 | A version control system typically has some mechanism to coordinate | 1385 | A version control system typically has some mechanism to coordinate |
| 1377 | between users who want to change the same file. There are two ways to | 1386 | between users who want to change the same file. There are two ways to |
| 1378 | do this: locking and merging. | 1387 | do this: merging and locking. |
| 1379 | |||
| 1380 | In a version control system that uses locking, work files are | ||
| 1381 | normally read-only. To edit a file, you ask the version control | ||
| 1382 | system to make it writable for you by @dfn{locking} it; only one user | ||
| 1383 | can lock a given file at any given time. This procedure is analogous | ||
| 1384 | to, but different from, the locking that Emacs uses to detect | ||
| 1385 | simultaneous editing of ordinary files (@pxref{Interlocking}). When | ||
| 1386 | you check in your changes, that unlocks the file, and the work file | ||
| 1387 | becomes read-only again. Other users may then lock the file for | ||
| 1388 | making their own changes. | ||
| 1389 | 1388 | ||
| 1390 | In a version control system that uses merging, each user may check | 1389 | In a version control system that uses merging, each user may check |
| 1391 | out and modify a work file at any time. The system allows you to | 1390 | out and modify a work file at any time. The system lets you |
| 1392 | @dfn{merge} your work file, which may contain changes that have not | 1391 | @dfn{merge} your work file, which may contain changes that have not |
| 1393 | been checked in, with the latest changes that others have checked into | 1392 | been checked in, with the latest changes that others have checked into |
| 1394 | the repository. | 1393 | the repository. |
| 1395 | 1394 | ||
| 1396 | Both locking and merging systems can have problems when multiple users | 1395 | Older version control systems use a @dfn{locking} scheme instead. |
| 1397 | try to modify the same file at the same time. Locking systems have | 1396 | Here, work files are normally read-only. To edit a file, you ask the |
| 1398 | @dfn{lock conflicts}; a user may try to check a file out and be unable | 1397 | version control system to make it writable for you by @dfn{locking} |
| 1399 | to because it is locked. In merging systems, @dfn{merge conflicts} | 1398 | it; only one user can lock a given file at any given time. This |
| 1400 | happen when you check in a change to a file that conflicts with a change | 1399 | procedure is analogous to, but different from, the locking that Emacs |
| 1401 | checked in by someone else after your checkout. Both kinds of conflict | 1400 | uses to detect simultaneous editing of ordinary files |
| 1402 | have to be resolved by human judgment and communication. | 1401 | (@pxref{Interlocking}). When you check in your changes, that unlocks |
| 1402 | the file, and the work file becomes read-only again. Other users may | ||
| 1403 | then lock the file to make their own changes. | ||
| 1404 | |||
| 1405 | Both locking and merging systems can have problems when multiple | ||
| 1406 | users try to modify the same file at the same time. Locking systems | ||
| 1407 | have @dfn{lock conflicts}; a user may try to check a file out and be | ||
| 1408 | unable to because it is locked. In merging systems, @dfn{merge | ||
| 1409 | conflicts} happen when you check in a change to a file that conflicts | ||
| 1410 | with a change checked in by someone else after your checkout. Both | ||
| 1411 | kinds of conflict have to be resolved by human judgment and | ||
| 1412 | communication. | ||
| 1403 | 1413 | ||
| 1404 | SCCS always uses locking. RCS is lock-based by default but can be | 1414 | SCCS always uses locking. RCS is lock-based by default but can be |
| 1405 | told to operate in a merging style. CVS and Subversion are | 1415 | told to operate in a merging style. CVS and Subversion are |
| 1406 | merge-based by default but can be told to operate in a locking mode. | 1416 | merge-based by default but can be told to operate in a locking mode. |
| 1407 | Most distributed version-control systems, such as GNU Arch, git, and | 1417 | Distributed version control systems, such as GNU Arch, git, and |
| 1408 | Mercurial, are based exclusively on merging rather than locking. This | 1418 | Mercurial, are exclusively merging-based. Experience has shown that |
| 1409 | is because experience has shown that merging is generally superior to | 1419 | merging is superior to locking, both in convenience to developers and |
| 1410 | locking, both in convenience to developers and in minimizing the | 1420 | in minimizing the number and severity of conflicts that actually |
| 1411 | number and severity of conflicts that actually occur. Sometimes, | 1421 | occur. Sometimes, however, newer version control systems may have |
| 1412 | newer version control systems may have locks retrofitted onto them for | 1422 | locks retrofitted onto them for reasons having nothing to do with |
| 1413 | reasons having nothing to do with technology@footnote{Usually the | 1423 | technology@footnote{Usually the control-freak instincts of managers.}. |
| 1414 | control-freak instincts of managers.}. | ||
| 1415 | 1424 | ||
| 1416 | VC mode supports both locking and merging version control and tries | 1425 | VC mode supports both locking and merging version control and tries |
| 1417 | to hide the differences between them as much as possible. | 1426 | to hide the differences between them as much as possible. |
| 1418 | 1427 | ||
| 1419 | @cindex files versus changesets. | 1428 | @cindex files versus changesets. |
| 1420 | On SCCS, RCS, CVS, and other early version-control systems, checkins | 1429 | On SCCS, RCS, CVS, and other early version control systems, version |
| 1421 | and other operations are @dfn{file-based}; each file has its own | 1430 | control operations are @dfn{file-based}: each file has its own comment |
| 1422 | @dfn{master file} with its own comment and revision history separate | 1431 | and revision history separate from that of all other files in the |
| 1423 | from that of all other files in the system. Later systems, beginning | 1432 | system. Later systems, beginning with Subversion, are |
| 1424 | with Subversion, are @dfn{changeset-based}: a checkin may include | 1433 | @dfn{changeset-based}: a checkin may include changes to several files, |
| 1425 | changes to several files, and the entire set of changes is treated as | 1434 | and the entire set of changes is treated as a unit by the system. Any |
| 1426 | a unit by the system. Any comment associated with the change does not | 1435 | comment associated with the change does not belong to a single file, |
| 1427 | belong to a single file, but to the changeset itself. | 1436 | but to the changeset itself. |
| 1428 | 1437 | ||
| 1429 | Changeset-based version control is generally more flexible and | 1438 | Changeset-based version control is more flexible and powerful than |
| 1430 | powerful than file-based version control; usually, when a change to | 1439 | file-based version control; usually, when a change to multiple files |
| 1431 | multiple files has to be backed out, it's good to be able to easily | 1440 | has to be reversed, it's good to be able to easily identify and remove |
| 1432 | identify and remove all of it. But it took some years for designers | 1441 | all of it. But it took some years for designers to figure that out, |
| 1433 | to figure that out, and while file-based systems are passing out of | 1442 | and while file-based systems are passing out of use, there are lots of |
| 1434 | use, there are lots of legacy repositories still to be dealt with as | 1443 | legacy repositories still to be dealt with as of this writing (2008). |
| 1435 | of this writing (2008). | 1444 | |
| 1436 | 1445 | Prior to Emacs 23, VC supported only file-based systems, leading to | |
| 1437 | Older versions of VC supported only file-based systems, leading to | 1446 | unhappy results when it was used to drive changeset-based |
| 1438 | some unhappy results when it was used to drive changeset-based | 1447 | systems---the Subversion support, for example, used to break up |
| 1439 | ones---the Subversion support, for example, used to break up | ||
| 1440 | changesets into multiple per-file commits. This has been fixed, but | 1448 | changesets into multiple per-file commits. This has been fixed, but |
| 1441 | it has left a legacy in VC's terminology. The terms ``checkin'' and | 1449 | it has left a mark in VC's terminology. The terms ``checkin'' and |
| 1442 | ``checkout'' are associated with file-based and locking-based systems | 1450 | ``checkout'' are associated with file-based and locking-based systems |
| 1443 | and a bit archaic; nowadays those operations are usually called | 1451 | and a bit archaic; nowadays those operations are usually called |
| 1444 | ``commit'' and ``update''. | 1452 | ``commit'' and ``update''. |
| 1445 | 1453 | ||
| 1446 | @cindex centralized vs. decentralized | 1454 | @cindex centralized vs. decentralized version control |
| 1447 | Early version-control systems were designed around a @dfn{centralized} | 1455 | Early version control systems were designed around a |
| 1448 | model in which each project has only one repository used by all | 1456 | @dfn{centralized} model in which each project has only one repository |
| 1449 | developers. SCCS, RCS, CVS, and Subversion share this kind of model. | 1457 | used by all developers. SCCS, RCS, CVS, and Subversion share this |
| 1450 | It has two important problems. One is that a single repository is a | 1458 | kind of model. One problem with this approach is that a single |
| 1451 | single point of failure---if the repository server is down all work | 1459 | repository is a single point of failure---if the repository server is |
| 1452 | stops. The other is that you need to be connected live to the server to | 1460 | down, all work stops. |
| 1453 | do checkins and checkouts; if you're offline, you can't work. | ||
| 1454 | 1461 | ||
| 1455 | Newer version-control systems like GNU Arch, git, Mercurial, and | 1462 | Newer version control systems like GNU Arch, git, Mercurial, and |
| 1456 | Bazaar are @dfn{decentralized}. A project may have several different | 1463 | Bazaar are @dfn{decentralized}. A project may have several different |
| 1457 | repositories, and these systems support a sort of super-merge between | 1464 | repositories, and these systems support a sort of super-merge between |
| 1458 | repositories that tries to reconcile their change histories. At the | 1465 | repositories that tries to reconcile their change histories. At the |
| @@ -1460,18 +1467,10 @@ limit, each developer has his/her own repository, and repository | |||
| 1460 | merges replace checkin/commit operations. | 1467 | merges replace checkin/commit operations. |
| 1461 | 1468 | ||
| 1462 | VC's job is to help you manage the traffic between your personal | 1469 | VC's job is to help you manage the traffic between your personal |
| 1463 | workfiles and a repository. Whether that repository is a single master | 1470 | workfiles and a repository. Whether that repository is a single |
| 1464 | or one of a network of peer repositories is not something VC has to care | 1471 | master or one of a network of peer repositories is not something VC |
| 1465 | about. Thus, the difference between a centralized and a decentralized | 1472 | has to care about. Thus, the difference between a centralized and a |
| 1466 | version-control system is invisible to VC mode. | 1473 | decentralized version control system is invisible to VC mode. |
| 1467 | |||
| 1468 | @iftex | ||
| 1469 | (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1470 | @end iftex | ||
| 1471 | @ifnottex | ||
| 1472 | (@pxref{CVS Options}). | ||
| 1473 | @end ifnottex | ||
| 1474 | |||
| 1475 | 1474 | ||
| 1476 | @node Types of Log File | 1475 | @node Types of Log File |
| 1477 | @subsubsection Types of Log File | 1476 | @subsubsection Types of Log File |
| @@ -1479,43 +1478,44 @@ version-control system is invisible to VC mode. | |||
| 1479 | @cindex log File, types of | 1478 | @cindex log File, types of |
| 1480 | @cindex version control log | 1479 | @cindex version control log |
| 1481 | 1480 | ||
| 1482 | Projects that use a revision control system can have @emph{two} | 1481 | Projects that use a version control system can have two types of log |
| 1483 | types of log for changes. One is the log maintained by the | 1482 | for changes. One is the log maintained by the version control system: |
| 1484 | revision control system: each time you check in a change, you must | 1483 | each time you check in a change, you fill out a @dfn{log entry} for |
| 1485 | fill out a @dfn{log entry} for the change (@pxref{Log Buffer}). This | 1484 | the change (@pxref{Log Buffer}). This is called the @dfn{version |
| 1486 | kind of log is called the @dfn{version control log}, also the | 1485 | control log}. |
| 1487 | @dfn{revision control log}, @dfn{RCS log}, or @dfn{CVS log}. | ||
| 1488 | 1486 | ||
| 1489 | The other kind of log is the file @file{ChangeLog} (@pxref{Change | 1487 | The other kind of log is the file @file{ChangeLog} (@pxref{Change |
| 1490 | Log}). It provides a chronological record of all changes to a large | 1488 | Log}). It provides a chronological record of all changes to a large |
| 1491 | portion of a program---typically one directory and its subdirectories. | 1489 | portion of a program---typically one directory and its subdirectories. |
| 1492 | A small program would use one @file{ChangeLog} file; a large program | 1490 | A small program would use one @file{ChangeLog} file; a large program |
| 1493 | may well merit a @file{ChangeLog} file in each major directory. | 1491 | may have a @file{ChangeLog} file in each major directory. |
| 1494 | @xref{Change Log}. | 1492 | @xref{Change Log}. |
| 1495 | 1493 | ||
| 1496 | Actually, the fact that both kinds of log exist is partly a legacy from | 1494 | Actually, the fact that both kinds of log exist is partly a legacy |
| 1497 | file-based version control. Changelogs are a GNU convention, later | 1495 | from file-based version control. Changelogs are a GNU convention, |
| 1498 | more widely adopted, that help developers to get a changeset-based | 1496 | later more widely adopted, that help developers to get a |
| 1499 | view of a project even when its version-control system has that | 1497 | changeset-based view of a project even when its version control system |
| 1500 | information split up in multiple file-based logs. | 1498 | has that information split up in multiple file-based logs. |
| 1501 | 1499 | ||
| 1502 | Changeset-based version systems, on the other hand, often maintain | 1500 | Changeset-based version systems, on the other hand, often maintain a |
| 1503 | a changeset-based modification log for the entire system that makes | 1501 | changeset-based modification log for the entire system that makes |
| 1504 | ChangeLogs mostly redundant. The only advantage ChangeLogs retain is that | 1502 | ChangeLogs somewhat redundant. One advantage that ChangeLogs retain |
| 1505 | it may be useful to be able to view the transaction history of a | 1503 | is that it is sometimes useful to be able to view the transaction |
| 1506 | single directory separately from those of other directories. | 1504 | history of a single directory separately from those of other |
| 1505 | directories. | ||
| 1507 | 1506 | ||
| 1508 | A project maintained with version control can use just the | 1507 | A project maintained with version control can use just the version |
| 1509 | version-control log, or it can use both kinds of logs. It can | 1508 | control log, or it can use both kinds of logs. It can handle some |
| 1510 | handle some files one way and some files the other way. Each project | 1509 | files one way and some files the other way. Each project has its |
| 1511 | has its policy, which you should follow. | 1510 | policy, which you should follow. |
| 1512 | 1511 | ||
| 1513 | When the policy is to use both, you typically want to write an entry | 1512 | When the policy is to use both, you typically want to write an entry |
| 1514 | for each change just once, then put it into both logs. You can write | 1513 | for each change just once, then put it into both logs. You can write |
| 1515 | the entry in @file{ChangeLog}, then copy it to the log buffer when you | 1514 | the entry in @file{ChangeLog}, then copy it to the log buffer with |
| 1516 | check in the change. Or you can write the entry in the log buffer | 1515 | @kbd{C-c C-a} when checking in the change (@pxref{Log Buffer}). Or |
| 1517 | while checking in the change, and later use the @kbd{C-x v a} command | 1516 | you can write the entry in the log buffer while checking in the |
| 1518 | to copy it to @file{ChangeLog} | 1517 | change, and later use the @kbd{C-x v a} command to copy it to |
| 1518 | @file{ChangeLog} | ||
| 1519 | @iftex | 1519 | @iftex |
| 1520 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). | 1520 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). |
| 1521 | @end iftex | 1521 | @end iftex |
| @@ -1537,6 +1537,13 @@ locking is not in use). @samp{:} indicates that the file is locked, or | |||
| 1537 | that it is modified. If the file is locked by some other user (for | 1537 | that it is modified. If the file is locked by some other user (for |
| 1538 | instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. | 1538 | instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. |
| 1539 | 1539 | ||
| 1540 | On a graphical display, you can move the mouse over this mode line | ||
| 1541 | indicator to pop up a ``tool-tip'', which displays a more verbose | ||
| 1542 | description of the version control status. Pressing @key{Mouse-1} | ||
| 1543 | over the indicator pops up a menu of VC commands. This menu is | ||
| 1544 | identical to the @samp{Version Control} menu item, which can be found | ||
| 1545 | in the @samp{Tools} menu on the menu bar. | ||
| 1546 | |||
| 1540 | @vindex auto-revert-check-vc-info | 1547 | @vindex auto-revert-check-vc-info |
| 1541 | When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is | 1548 | When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is |
| 1542 | under version control, it updates the version control information in | 1549 | under version control, it updates the version control information in |
| @@ -1552,155 +1559,143 @@ system, but is usually not excessive. | |||
| 1552 | @node Basic VC Editing | 1559 | @node Basic VC Editing |
| 1553 | @subsection Basic Editing under Version Control | 1560 | @subsection Basic Editing under Version Control |
| 1554 | 1561 | ||
| 1555 | @menu | ||
| 1556 | * Selecting A Fileset:: Choosing a set of files to operate on | ||
| 1557 | * Doing The Right Thing:: Stepping forward in the development cycle | ||
| 1558 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. | ||
| 1559 | * VC With A Merging VCS:: Without locking: default mode for CVS. | ||
| 1560 | * Advanced C-x v v:: Advanced features available with a prefix argument. | ||
| 1561 | * Log Buffer:: Features available in log entry buffers. | ||
| 1562 | @end menu | ||
| 1563 | |||
| 1564 | @node Selecting A Fileset | ||
| 1565 | @subsubsection Choosing the scope of your command | ||
| 1566 | |||
| 1567 | @cindex filesets | 1562 | @cindex filesets |
| 1568 | Most VC commands operate on @dfn{filesets}. A fileset is a | 1563 | Most VC commands operate on @dfn{VC filesets}. A VC fileset is a |
| 1569 | group of files that you have chosen to treat as a unit at the | 1564 | group of one or more files that are treated as a unit, for the |
| 1570 | time you perform the command. Filesets are the way that VC | 1565 | purposes of version control. |
| 1571 | mode bridges the gap between file-based and changeset-based | ||
| 1572 | version-control systems. | ||
| 1573 | |||
| 1574 | If you are visiting a version-controlled file in the current buffer, | ||
| 1575 | the default fileset for any command is simply that one file. If you | ||
| 1576 | are visiting a VC directory buffer, and some files in it are marked, | ||
| 1577 | your fileset is the marked files only. | ||
| 1578 | |||
| 1579 | All files in a fileset must be under the same version-control system. | ||
| 1580 | If they are not, VC mode will fail when you attempt to execute | ||
| 1581 | a command on the fileset. | ||
| 1582 | |||
| 1583 | VC filesets are, essentially, a way to pass multiple file | ||
| 1584 | arguments as a group to underlying version-control commands. For | ||
| 1585 | example, on Subversion a checkin with more than one file in its | ||
| 1586 | fileset will become a joint commit, as though you had typed | ||
| 1587 | @command{svn commit} with those file arguments at the shell command | ||
| 1588 | line in the directory of the selected buffer. | ||
| 1589 | |||
| 1590 | If you are accustomed to earlier versions of VC, the change in behavior | ||
| 1591 | you will notice is in the directory mode. Other than @kbd{C-x v v}, most | ||
| 1592 | VC-mode commands once operated on only one file selected by the line | ||
| 1593 | the cursor is on. The change in the behavior of @kbd{C-x v v} outside | ||
| 1594 | VC Directory Mode is more subtle. Formerly it operated in parallel on all | ||
| 1595 | marked files, but did not pass them to the version-control backends as | ||
| 1596 | a group. Now it does, which enables VC to drive changeset-based | ||
| 1597 | version-control systems. | ||
| 1598 | |||
| 1599 | Emacs uses the concept of named filesets elsewhere | ||
| 1600 | (@pxref{Filesets}) to allow you to view and visit files in functional | ||
| 1601 | groups. Unlike those, VC filesets are not named and don't persist | ||
| 1602 | across sessions. | ||
| 1603 | 1566 | ||
| 1604 | @node Doing The Right Thing | 1567 | If you are visiting a version-controlled file in the current |
| 1605 | @subsubsection Performing the next operation in the development cycle | 1568 | buffer, the VC fileset is simply that one file. If you are visiting a |
| 1569 | VC directory buffer, and some files in it are marked, the VC fileset | ||
| 1570 | consists of the marked files (@pxref{VC Directory Mode}). | ||
| 1606 | 1571 | ||
| 1607 | The principal VC command is an all-purpose command that performs | 1572 | The principal VC command is an all-purpose command, @kbd{C-x v v} |
| 1608 | either locking or check-in on your current fileset, depending on | 1573 | (@code{vc-next-action}), that performs either locking, merging or a |
| 1609 | the situation. | 1574 | check-in on the current VC fileset, depending on the situation. You |
| 1575 | can call @kbd{C-x v v} from a version-controlled file, or from the VC | ||
| 1576 | Directory buffer. | ||
| 1610 | 1577 | ||
| 1611 | @table @kbd | 1578 | @table @kbd |
| 1612 | @itemx C-x v v | 1579 | @itemx C-x v v |
| 1613 | Perform the next logical version control operation on this file. | 1580 | Perform the next logical version control operation on the VC fileset. |
| 1614 | @end table | 1581 | @end table |
| 1615 | 1582 | ||
| 1616 | @findex vc-next-action | 1583 | @findex vc-next-action |
| 1617 | @kindex C-x v v | 1584 | @kindex C-x v v |
| 1618 | The precise action of this command depends on the state of the file, | 1585 | The precise action of @kbd{C-x v v} depends on the state of the VC |
| 1619 | and whether the version control system uses locking or merging. SCCS and | 1586 | fileset, and whether the version control system uses locking or |
| 1620 | RCS normally use locking; CVS and Subversion normally use | 1587 | merging. This is described in detail in the subsequent sections. |
| 1621 | merging but can be configured to do locking. Later systems such as | 1588 | |
| 1622 | GNU Arch and Mercurial always use merging. | 1589 | VC filesets are the way that VC mode bridges the gap between |
| 1590 | file-based and changeset-based version control systems. They are, | ||
| 1591 | essentially, a way to pass multiple file arguments as a group to | ||
| 1592 | version control commands. For example, on Subversion, a checkin with | ||
| 1593 | a multi-file VC fileset becomes a joint commit, as though you had | ||
| 1594 | typed @command{svn commit} with those file arguments at the shell | ||
| 1595 | command line. All files in a VC fileset must be under the same | ||
| 1596 | version control system; if they are not, Emacs signals an error when | ||
| 1597 | you attempt to execute a command on the fileset. | ||
| 1598 | |||
| 1599 | If you are accustomed to previous versions of VC, most of the | ||
| 1600 | changes to VC in Emacs 23 are found in VC directory mode (@pxref{VC | ||
| 1601 | Directory Mode}). When multiple files are marked in the VC directory | ||
| 1602 | buffer, they are treated as a VC fileset; typing @kbd{C-x v v} in the | ||
| 1603 | VC directory buffer passes them to the version control backends as a | ||
| 1604 | single unit. Other commands in VC directory mode now act on the VC | ||
| 1605 | fileset, rather than the file on the current line. These changes | ||
| 1606 | allow VC to interoperate correctly with changeset-based version | ||
| 1607 | control systems. | ||
| 1608 | |||
| 1609 | VC filesets are distinct from the ``named filesets'' used for | ||
| 1610 | viewing and visiting files in functional groups (@pxref{Filesets}). | ||
| 1611 | Unlike named filesets, VC filesets are not named and don't persist | ||
| 1612 | across sessions. | ||
| 1623 | 1613 | ||
| 1624 | @node VC With A Locking VCS | 1614 | @menu |
| 1625 | @subsubsection Basic Version Control with Locking | 1615 | * VC With A Merging VCS:: Without locking: default mode for CVS. |
| 1616 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. | ||
| 1617 | * Advanced C-x v v:: Advanced features available with a prefix argument. | ||
| 1618 | * Log Buffer:: Features available in log entry buffers. | ||
| 1619 | @end menu | ||
| 1620 | |||
| 1621 | @node VC With A Merging VCS | ||
| 1622 | @subsubsection Basic Version Control with Merging | ||
| 1626 | 1623 | ||
| 1627 | If locking is used for the file (as with SCCS, and RCS in its default | 1624 | When your version control system is merging-based (the default for |
| 1628 | mode), @kbd{C-x v v} can either lock a file or check it in: | 1625 | CVS and all newer version control systems), work files are always |
| 1626 | writable; you need not do anything special to begin editing a file. | ||
| 1627 | The status indicator on the mode line is @samp{-} if the file is | ||
| 1628 | unmodified; it flips to @samp{:} as soon as you save any changes | ||
| 1629 | (@pxref{VC Mode Line}). | ||
| 1629 | 1630 | ||
| 1630 | @itemize @bullet | 1631 | Here is what @kbd{C-x v v} does when using a merging-based system: |
| 1631 | @item | ||
| 1632 | If the file is not locked, @kbd{C-x v v} locks it, and | ||
| 1633 | makes it writable so that you can change it. | ||
| 1634 | 1632 | ||
| 1633 | @itemize @bullet | ||
| 1635 | @item | 1634 | @item |
| 1636 | If the file is locked by you, and contains changes, @kbd{C-x v v} checks | 1635 | If the work file is the same as in the repository, it does nothing. |
| 1637 | in the changes. In order to do this, it first reads the log entry | ||
| 1638 | for the new revision. @xref{Log Buffer}. | ||
| 1639 | 1636 | ||
| 1640 | @item | 1637 | @item |
| 1641 | If the file is locked by you, but you have not changed it since you | 1638 | If you have not changed the work file, but some other user has checked |
| 1642 | locked it, @kbd{C-x v v} releases the lock and makes the file read-only | 1639 | in changes to the repository, @kbd{C-x v v} merges those changes into |
| 1643 | again. | 1640 | the work file. |
| 1644 | 1641 | ||
| 1645 | @item | 1642 | @item |
| 1646 | If the file is locked by some other user, @kbd{C-x v v} asks you whether | 1643 | If you have made modifications to the work file, @kbd{C-x v v} |
| 1647 | you want to ``steal the lock'' from that user. If you say yes, the file | 1644 | attempts to check in your changes. To do this, Emacs first reads the |
| 1648 | becomes locked by you, but a message is sent to the person who had | 1645 | log entry for the new revision (@pxref{Log Buffer}). If some other |
| 1649 | formerly locked the file, to inform him of what has happened. | 1646 | user has checked in changes to the repository since you last checked |
| 1647 | it out, the checkin fails. In that case, type @kbd{C-x v v} again to | ||
| 1648 | merge those changes into your own work file; this puts the work file | ||
| 1649 | into a ``conflicted'' state. Type @kbd{C-x v v} to clear the | ||
| 1650 | ``conflicted'' state; VC then regards the file as up-to-date and | ||
| 1651 | modified, and you can try to check it in again. | ||
| 1652 | |||
| 1653 | To pick up any recent changes from the repository @emph{without} | ||
| 1654 | trying to commit your own changes, type @kbd{C-x v m @key{RET}}. | ||
| 1655 | @xref{Merging}. | ||
| 1650 | @end itemize | 1656 | @end itemize |
| 1651 | 1657 | ||
| 1652 | These rules also apply when you use CVS in locking mode, except | 1658 | These rules also apply when you use RCS in its ``non-locking'' mode, |
| 1653 | that there is no such thing as stealing a lock. | 1659 | except that changes will not be automatically merged from the |
| 1660 | repository. Nothing informs you if another user has checked in | ||
| 1661 | changes in the same file since you began editing it; when you check in | ||
| 1662 | your revision, his changes are removed (however, they remain in the | ||
| 1663 | repository and are thus not irrevocably lost). Therefore, you must | ||
| 1664 | verify that the current revision is unchanged before checking in your | ||
| 1665 | changes. In addition, locking is possible with RCS even in this mode: | ||
| 1666 | @kbd{C-x v v} with an unmodified file locks the file, just as it does | ||
| 1667 | with RCS in its normal locking mode (@pxref{VC With A Locking VCS}). | ||
| 1654 | 1668 | ||
| 1655 | @node VC With A Merging VCS | 1669 | @node VC With A Locking VCS |
| 1656 | @subsubsection Basic Version Control with Merging | 1670 | @subsubsection Basic Version Control with Locking |
| 1657 | 1671 | ||
| 1658 | When your version-control system is merging-based rather than | 1672 | Under a locking-based version control system (such as SCCS, and RCS |
| 1659 | locking-based---the default for CVS and Subversion, and the way GNU | 1673 | in its default mode), @kbd{C-x v v} does the following: |
| 1660 | Arch and more modern systems always work---work files are always | ||
| 1661 | writable; you do not need to do anything before you begin to edit a | ||
| 1662 | file. The status indicator on the mode line is @samp{-} if the file | ||
| 1663 | is unmodified; it flips to @samp{:} as soon as you save any changes in | ||
| 1664 | the work file. | ||
| 1665 | 1674 | ||
| 1666 | Here is what @kbd{C-x v v} does when using a merging-based system | 1675 | @itemize @bullet |
| 1667 | (such as CVS or Subversion in their default merging mode): | 1676 | @item |
| 1677 | If the file is not locked, @kbd{C-x v v} locks it, and makes it | ||
| 1678 | writable so that you can change it. | ||
| 1668 | 1679 | ||
| 1669 | @itemize @bullet | ||
| 1670 | @item | 1680 | @item |
| 1671 | If some other user has checked in changes into the repository, Emacs | 1681 | If the file is locked by you, and contains changes, @kbd{C-x v v} |
| 1672 | asks you whether you want to merge those changes into your own work | 1682 | checks in the changes. In order to do this, it first reads the log |
| 1673 | file. You must do this before you can check in your own changes. (To | 1683 | entry for the new revision. @xref{Log Buffer}. |
| 1674 | pick up any recent changes from the repository @emph{without} trying | ||
| 1675 | to commit your own changes, type @kbd{C-x v m @key{RET}}.) | ||
| 1676 | @xref{Merging}. | ||
| 1677 | 1684 | ||
| 1678 | @item | 1685 | @item |
| 1679 | If there are no new changes in the repository, but you have made | 1686 | If the file is locked by you, but you have not changed it since you |
| 1680 | modifications in your work file, @kbd{C-x v v} checks in your changes. | 1687 | locked it, @kbd{C-x v v} releases the lock and makes the file |
| 1681 | In order to do this, it first reads the log entry for the new revision. | 1688 | read-only again. |
| 1682 | @xref{Log Buffer}. | ||
| 1683 | 1689 | ||
| 1684 | @item | 1690 | @item |
| 1685 | If the file is not modified, the @kbd{C-x v v} does nothing. | 1691 | If the file is locked by some other user, @kbd{C-x v v} asks you whether |
| 1692 | you want to ``steal the lock'' from that user. If you say yes, the file | ||
| 1693 | becomes locked by you, but a message is sent to the person who had | ||
| 1694 | formerly locked the file, to inform him of what has happened. | ||
| 1686 | @end itemize | 1695 | @end itemize |
| 1687 | 1696 | ||
| 1688 | These rules also apply when you use RCS in the mode that does not | 1697 | These rules also apply when you use CVS in locking mode, except |
| 1689 | require locking, except that automatic merging of changes from the | 1698 | that there is no such thing as stealing a lock. |
| 1690 | repository is not implemented. Unfortunately, this means that nothing | ||
| 1691 | informs you if another user has checked in changes in the same file | ||
| 1692 | since you began editing it, and when this happens, his changes will be | ||
| 1693 | effectively removed when you check in your revision (though they will | ||
| 1694 | remain in the repository, so they will not be entirely lost). You must | ||
| 1695 | therefore verify that the current revision is unchanged, before you | ||
| 1696 | check in your changes. | ||
| 1697 | |||
| 1698 | In addition, locking is possible with RCS even in this mode, although | ||
| 1699 | it is not required; @kbd{C-x v v} with an unmodified file locks the | ||
| 1700 | file, just as it does with RCS in its normal (locking) mode. | ||
| 1701 | |||
| 1702 | Later systems like CVS, Subversion and Arch will notice conflicting | ||
| 1703 | changes in the repository automatically and notify you when they occur. | ||
| 1704 | 1699 | ||
| 1705 | @node Advanced C-x v v | 1700 | @node Advanced C-x v v |
| 1706 | @subsubsection Advanced Control in @kbd{C-x v v} | 1701 | @subsubsection Advanced Control in @kbd{C-x v v} |
| @@ -1743,22 +1738,35 @@ Features}). | |||
| 1743 | @node Log Buffer | 1738 | @node Log Buffer |
| 1744 | @subsubsection Features of the Log Entry Buffer | 1739 | @subsubsection Features of the Log Entry Buffer |
| 1745 | 1740 | ||
| 1746 | When you check in changes, @kbd{C-x v v} first reads a log entry. It | 1741 | When you check in changes, Emacs pops up a buffer called |
| 1747 | pops up a buffer called @samp{*VC-Log*} for you to enter the log entry. | 1742 | @samp{*VC-Log*} for you to enter a log entry. |
| 1743 | |||
| 1744 | After you have finished editing the log message, type @kbd{C-c C-c} | ||
| 1745 | to exit the buffer and commit the change. | ||
| 1748 | 1746 | ||
| 1749 | Sometimes the @samp{*VC-Log*} buffer contains default text when you enter it, | 1747 | @findex log-edit-show-files |
| 1750 | typically the last log message entered. If it does, mark and point | 1748 | @findex log-edit-show-diff |
| 1751 | are set around the entire contents of the buffer so that it is easy to | 1749 | In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f} |
| 1752 | kill the contents of the buffer with @kbd{C-w}. | 1750 | (@code{log-edit-show-files}) displays a list of files in the VC |
| 1751 | fileset you are committing. If you called @kbd{C-x v v} directly from | ||
| 1752 | a work file, the VC fileset consists of that single file, so this | ||
| 1753 | command is not very useful. If you called @kbd{C-x v v} from a VC | ||
| 1754 | directory buffer, the VC fileset may consist of multiple files | ||
| 1755 | (@pxref{VC Directory Mode}). | ||
| 1753 | 1756 | ||
| 1754 | @findex log-edit-insert-changelog | 1757 | @findex log-edit-insert-changelog |
| 1755 | If you work by first writing entries in the @file{ChangeLog} | 1758 | Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of |
| 1756 | (@pxref{Change Log}) and afterwards committing the change under revision | 1759 | the changes you have made (i.e., the differences between the work file |
| 1757 | control, you can generate the Log Edit text from the ChangeLog using | 1760 | and the repository revision from which you started editing the file). |
| 1758 | @kbd{C-c C-a} (@kbd{log-edit-insert-changelog}). This looks for | 1761 | The diff is displayed in a special buffer in another window. |
| 1759 | entries for the file(s) concerned in the top entry in the ChangeLog | 1762 | @xref{Comparing Files}. |
| 1760 | and uses those paragraphs as the log text. This text is only inserted | 1763 | |
| 1761 | if the top entry was made under your user name on the current date. | 1764 | If you have written an entry in the @file{ChangeLog} (@pxref{Change |
| 1765 | Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull | ||
| 1766 | it into the @samp{*VC-Log*} buffer. If the topmost item in the | ||
| 1767 | @file{ChangeLog} was made under your user name on the current date, | ||
| 1768 | this command searches that item for entries that match the file(s) to | ||
| 1769 | be committed; if found, these entries are inserted. | ||
| 1762 | @iftex | 1770 | @iftex |
| 1763 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, | 1771 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, |
| 1764 | @end iftex | 1772 | @end iftex |
| @@ -1768,52 +1776,32 @@ if the top entry was made under your user name on the current date. | |||
| 1768 | for the opposite way of working---generating ChangeLog entries from | 1776 | for the opposite way of working---generating ChangeLog entries from |
| 1769 | the revision control log. | 1777 | the revision control log. |
| 1770 | 1778 | ||
| 1771 | @findex log-edit-show-files | 1779 | To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that |
| 1772 | @findex log-edit-show-diff | ||
| 1773 | In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} | ||
| 1774 | (@code{log-edit-show-files}) shows the list of files to be committed | ||
| 1775 | in case you need to check that. (This can be a list of more than one | ||
| 1776 | file if you use VC Directory Mode or PCL-CVS.) @kbd{C-c C-d} | ||
| 1777 | (@code{log-edit-show-diff}) shows the diffs for the files to be | ||
| 1778 | committed. | ||
| 1779 | @iftex | ||
| 1780 | @xref{VC Directory Mode,,,emacs-xtra, Specialized Emacs Features}, | ||
| 1781 | @end iftex | ||
| 1782 | @ifnottex | ||
| 1783 | @xref{VC Directory Mode}, | ||
| 1784 | @end ifnottex | ||
| 1785 | and @ref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs | ||
| 1786 | Front-End to CVS}.) | ||
| 1787 | |||
| 1788 | When you have finished editing the log message, type @kbd{C-c C-c} to | ||
| 1789 | exit the buffer and commit the change. | ||
| 1790 | |||
| 1791 | To abort check-in, just @strong{don't} type @kbd{C-c C-c} in that | ||
| 1792 | buffer. You can switch buffers and do other editing. As long as you | 1780 | buffer. You can switch buffers and do other editing. As long as you |
| 1793 | don't try to check in another file, the entry you were editing remains | 1781 | don't try to check in another file, the entry you were editing remains |
| 1794 | in the @samp{*VC-Log*} buffer, and you can go back to that buffer at any | 1782 | in the @samp{*VC-Log*} buffer, and you can go back to that buffer at |
| 1795 | time to complete the check-in. | 1783 | any time to complete the check-in. |
| 1796 | 1784 | ||
| 1797 | If you change several source files for the same reason, it is often | 1785 | If you change several source files for the same reason, it is often |
| 1798 | convenient to specify the same log entry for many of the files. (This | 1786 | convenient to specify the same log entry for many of the files. (This |
| 1799 | is the normal way to do things on a changeset-oriented system, where | 1787 | is the normal way to do things on a changeset-oriented system, where |
| 1800 | comments are attached to changesets rather than the history of | 1788 | comments are attached to changesets rather than the history of |
| 1801 | individual files.) The most convenient way to do this is to mark all the | 1789 | individual files.) The most convenient way to do this is to mark all |
| 1802 | files in VC Directory Mode and check in from there; the log buffer will | 1790 | the files in VC Directory Mode and check in from there; the log buffer |
| 1803 | carry the fileset information with it and do a group commit when you | 1791 | will carry the fileset information with it and do a group commit when |
| 1804 | confirm it with @kbd{C-c C-c}. | 1792 | you type @kbd{C-c C-c}. |
| 1805 | 1793 | ||
| 1806 | However, you can also browse the history of previous log entries to | 1794 | You can also browse the history of previous log entries to duplicate |
| 1807 | duplicate a checkin comment. This can be useful when you want several | 1795 | a checkin comment. This can be useful when you want several files to |
| 1808 | files to have checkin comments that vary only slightly from each | 1796 | have checkin comments that vary only slightly from each other. The |
| 1809 | other. The commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for | 1797 | commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this |
| 1810 | doing this work just like the minibuffer history commands (except that | 1798 | work just like the minibuffer history commands (except that these |
| 1811 | these versions are used outside the minibuffer). | 1799 | versions are used outside the minibuffer). |
| 1812 | 1800 | ||
| 1813 | @vindex vc-log-mode-hook | 1801 | @vindex vc-log-mode-hook |
| 1814 | Each time you check in a change, the log entry buffer is put into VC Log | 1802 | Each time you check in a change, the log entry buffer is put into VC |
| 1815 | mode, which involves running two hooks: @code{text-mode-hook} and | 1803 | Log Edit mode, which involves running two hooks: @code{text-mode-hook} |
| 1816 | @code{vc-log-mode-hook}. @xref{Hooks}. | 1804 | and @code{vc-log-mode-hook}. @xref{Hooks}. |
| 1817 | 1805 | ||
| 1818 | @node Old Revisions | 1806 | @node Old Revisions |
| 1819 | @subsection Examining And Comparing Old Revisions | 1807 | @subsection Examining And Comparing Old Revisions |
| @@ -1834,54 +1822,59 @@ fileset with the working revision(s) from which you started editing. | |||
| 1834 | Compare the specified two repository revisions of the current fileset. | 1822 | Compare the specified two repository revisions of the current fileset. |
| 1835 | 1823 | ||
| 1836 | @item C-x v g | 1824 | @item C-x v g |
| 1837 | Display the file with per-line revision information and using colors. | 1825 | Display an annotated version of the file: for each line, show the |
| 1826 | latest revision in which it was modified. | ||
| 1838 | @end table | 1827 | @end table |
| 1839 | 1828 | ||
| 1840 | @findex vc-revision-other-window | 1829 | @findex vc-revision-other-window |
| 1841 | @kindex C-x v ~ | 1830 | @kindex C-x v ~ |
| 1842 | To examine an old revision in its entirety, visit the file and then type | 1831 | To examine an old revision, visit the work file and type @kbd{C-x v |
| 1843 | @kbd{C-x v ~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). | 1832 | ~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). Here, |
| 1844 | This puts the text of revision @var{revision} in a file named | 1833 | @var{revision} is either the desired revision ID (@pxref{VCS |
| 1845 | @file{@var{filename}.~@var{revision}~}, and visits it in its own buffer | 1834 | Concepts}), or the name of a tag or branch |
| 1846 | in a separate window. (In RCS, you can also select an old revision | 1835 | @iftex |
| 1847 | and create a branch from it. @xref{Branches}.) | 1836 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). |
| 1837 | @end iftex | ||
| 1838 | @ifnottex | ||
| 1839 | (@pxref{Tags}). | ||
| 1840 | @end ifnottex | ||
| 1841 | This command puts the text of the old revision in a file named | ||
| 1842 | @file{@var{filename}.~@var{revision}~}, and visits it in its own | ||
| 1843 | buffer in a separate window. | ||
| 1848 | 1844 | ||
| 1849 | @findex vc-diff | 1845 | @findex vc-diff |
| 1850 | @kindex C-x v = | 1846 | @kindex C-x v = |
| 1851 | @kbd{C-x v =} compares the current buffer contents of each file in the | 1847 | @kbd{C-x v =} (@code{vc-diff}) compares the current buffer contents |
| 1852 | current fileset (saving them in the file if necessary) with the | 1848 | of each file in the current VC fileset (saving them if necessary) with |
| 1853 | repository revision from which you started editing each file (this is not | 1849 | the repository revision from which you started editing. Note that the |
| 1854 | necessarily the latest revision of the file). The diff will be displayed | 1850 | latter may or may not be the latest revision of the file(s). The diff |
| 1855 | in a special buffer in another window. | 1851 | is displayed in a special buffer in another window. @xref{Comparing |
| 1852 | Files}. | ||
| 1856 | 1853 | ||
| 1857 | @findex vc-diff | 1854 | @findex vc-diff |
| 1858 | @kindex C-u C-x v = | 1855 | @kindex C-u C-x v = |
| 1859 | You can compare two repository revisions of the current fileset with | 1856 | To compare two arbitrary revisions of the current VC fileset, call |
| 1860 | the command @kbd{C-u C-x v =} (@code{vc-diff}). @kbd{C-u C-x v =} reads | 1857 | @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This |
| 1861 | two revision ID or tags. The diff will be displayed in a special | 1858 | prompts for two revision IDs, using the minibuffer, and displays the |
| 1862 | buffer in another window. | 1859 | diff in a special buffer in another window. Instead of providing a |
| 1863 | 1860 | revision ID, you can give an empty input, which specifies the current | |
| 1864 | You can specify a checked-in revision by its ID; an empty input | 1861 | contents of the work file; or a tag or branch name |
| 1865 | specifies the current contents of the work file (which may be different | ||
| 1866 | from all the checked-in revisions). You can also specify a tag or branch name | ||
| 1867 | @iftex | 1862 | @iftex |
| 1868 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}) | 1863 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). |
| 1869 | @end iftex | 1864 | @end iftex |
| 1870 | @ifnottex | 1865 | @ifnottex |
| 1871 | (@pxref{Tags}) | 1866 | (@pxref{Tags}). |
| 1872 | @end ifnottex | 1867 | @end ifnottex |
| 1873 | instead of one or both revision ID. | 1868 | If your version control system is file-based (e.g. CVS) rather than |
| 1874 | 1869 | changeset-based (Subversion, GNU Arch, git, Mercurial), supplying a | |
| 1875 | Note that if your version-control system is file-oriented (SCCS, | 1870 | revision ID for a multi-file fileset (as opposed to a symbolic tag |
| 1876 | RCS, CVS) rather than fileset-oriented (Subversion, GNU Arch, git, | 1871 | name) is unlikely to return diffs that are connected in any meaningful |
| 1877 | Mercurial) specifying a revision of a multiple-file fileset by | 1872 | way. |
| 1878 | revision ID (as opposed to a symbolic tag name) is | ||
| 1879 | unlikely to return diffs that are connected in any meaningful way. | ||
| 1880 | 1873 | ||
| 1881 | If you invoke @kbd{C-u C-x v =} or @kbd{C-u C-x v =} from a buffer | 1874 | If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that |
| 1882 | that is neither visiting a version-controlled file nor a VC directory | 1875 | is neither visiting a version-controlled file nor a VC directory |
| 1883 | buffer, these commands will generate a diff of all registered files in | 1876 | buffer, these commands generate a diff of all registered files in the |
| 1884 | the current directory and its subdirectories. | 1877 | current directory and its subdirectories. |
| 1885 | 1878 | ||
| 1886 | @vindex vc-diff-switches | 1879 | @vindex vc-diff-switches |
| 1887 | @vindex vc-rcs-diff-switches | 1880 | @vindex vc-rcs-diff-switches |
| @@ -1891,8 +1884,8 @@ invoke @code{diff} this way, in addition to the options specified by | |||
| 1891 | @code{diff-switches} (@pxref{Comparing Files}), it receives those | 1884 | @code{diff-switches} (@pxref{Comparing Files}), it receives those |
| 1892 | specified by @code{vc-diff-switches}, plus those specified for the | 1885 | specified by @code{vc-diff-switches}, plus those specified for the |
| 1893 | specific back end by @code{vc-@var{backend}-diff-switches}. For | 1886 | specific back end by @code{vc-@var{backend}-diff-switches}. For |
| 1894 | instance, when the version control back end is RCS, @code{diff} uses | 1887 | instance, when the version control back end is CVS, @code{diff} uses |
| 1895 | the options in @code{vc-rcs-diff-switches}. The | 1888 | the options in @code{vc-cvs-diff-switches}. The |
| 1896 | @samp{vc@dots{}diff-switches} variables are @code{nil} by default. | 1889 | @samp{vc@dots{}diff-switches} variables are @code{nil} by default. |
| 1897 | 1890 | ||
| 1898 | The buffer produced by @kbd{C-x v =} supports the commands of | 1891 | The buffer produced by @kbd{C-x v =} supports the commands of |
| @@ -1904,13 +1897,13 @@ revisions are not, in general, present as files on your disk.) | |||
| 1904 | @findex vc-annotate | 1897 | @findex vc-annotate |
| 1905 | @kindex C-x v g | 1898 | @kindex C-x v g |
| 1906 | For some back ends, you can display the file @dfn{annotated} with | 1899 | For some back ends, you can display the file @dfn{annotated} with |
| 1907 | per-line revision information and using colors to enhance the visual | 1900 | per-line revision information, by typing @kbd{C-x v g} |
| 1908 | appearance, with the command @kbd{M-x vc-annotate}. This creates a new | 1901 | (@code{vc-annotate}). This creates a new buffer (the ``annotate |
| 1909 | buffer (the ``annotate buffer'') displaying the file's text, with each | 1902 | buffer'') displaying the file's text, with each part colored to show |
| 1910 | part colored to show how old it is. Text colored red is new, blue means | 1903 | how old it is. Text colored red is new, blue means old, and |
| 1911 | old, and intermediate colors indicate intermediate ages. By default, | 1904 | intermediate colors indicate intermediate ages. By default, the color |
| 1912 | the color is scaled over the full range of ages, such that the oldest | 1905 | is scaled over the full range of ages, such that the oldest changes |
| 1913 | changes are blue, and the newest changes are red. | 1906 | are blue, and the newest changes are red. |
| 1914 | 1907 | ||
| 1915 | When you give a prefix argument to this command, Emacs reads two | 1908 | When you give a prefix argument to this command, Emacs reads two |
| 1916 | arguments using the minibuffer: the ID of which revision to display and | 1909 | arguments using the minibuffer: the ID of which revision to display and |
| @@ -1972,17 +1965,12 @@ the file contents without distraction from the annotations. | |||
| 1972 | @node Secondary VC Commands | 1965 | @node Secondary VC Commands |
| 1973 | @subsection The Secondary Commands of VC | 1966 | @subsection The Secondary Commands of VC |
| 1974 | 1967 | ||
| 1975 | This section explains the secondary commands of VC, those that you might | 1968 | This section explains the secondary commands of VC. |
| 1976 | use once a day. | ||
| 1977 | 1969 | ||
| 1978 | @menu | 1970 | @menu |
| 1979 | * Registering:: Putting a file under version control. | 1971 | * Registering:: Putting a file under version control. |
| 1980 | * VC Status:: Viewing the VC status of files. | 1972 | * VC Status:: Viewing the VC status of files. |
| 1981 | * VC Undo:: Canceling changes before or after check-in. | 1973 | * VC Undo:: Canceling changes before or after check-in. |
| 1982 | @ifnottex | ||
| 1983 | * VC Directory Mode:: Listing files managed by version control. | ||
| 1984 | * VC Directory Commands:: Commands to use in a VC directory buffer. | ||
| 1985 | @end ifnottex | ||
| 1986 | @end menu | 1974 | @end menu |
| 1987 | 1975 | ||
| 1988 | @node Registering | 1976 | @node Registering |
| @@ -2048,14 +2036,16 @@ Display revision control state and change history. | |||
| 2048 | @kindex C-x v l | 2036 | @kindex C-x v l |
| 2049 | @findex vc-print-log | 2037 | @findex vc-print-log |
| 2050 | To view the detailed revision control status and history of a file, | 2038 | To view the detailed revision control status and history of a file, |
| 2051 | type @kbd{C-x v l} (@code{vc-print-log}). It displays the history of | 2039 | type @kbd{C-x v l} (@code{vc-print-log}). This pops up a special |
| 2052 | changes to the current file, including the text of the log entries. The | 2040 | buffer named @samp{*vc-change-log*}, in a new window, that displays |
| 2053 | output appears in a separate window. The point is centered at the | 2041 | the history of changes to the current file, including the text of the |
| 2054 | revision of the file that is currently being visited. | 2042 | log entries. The point is centered at the revision of the file that |
| 2043 | is currently being visited. | ||
| 2055 | 2044 | ||
| 2056 | In the change log buffer, you can use the following keys to move | 2045 | In the @samp{*vc-change-log*} buffer, you can use the following keys |
| 2057 | between the logs of revisions and of files, to view past revisions, to | 2046 | to move between the logs of revisions and of files, to view past |
| 2058 | modify change comments, to view annotations and to view diffs: | 2047 | revisions, to modify change comments, to view annotations and to view |
| 2048 | diffs: | ||
| 2059 | 2049 | ||
| 2060 | @table @kbd | 2050 | @table @kbd |
| 2061 | @item p | 2051 | @item p |
| @@ -2071,27 +2061,14 @@ count. | |||
| 2071 | 2061 | ||
| 2072 | @item P | 2062 | @item P |
| 2073 | Move to the log of the previous file, when the logs of multiple files | 2063 | Move to the log of the previous file, when the logs of multiple files |
| 2074 | are in the log buffer | 2064 | are in the log buffer (@pxref{VC Directory Mode}). Otherwise, just |
| 2075 | @iftex | 2065 | move to the beginning of the log. A numeric prefix argument is a |
| 2076 | (@pxref{VC Directory Mode,,,emacs-xtra, Specialized Emacs Features}). | 2066 | repeat count, so @kbd{C-u 10 P} would move backward 10 files. |
| 2077 | @end iftex | ||
| 2078 | @ifnottex | ||
| 2079 | (@pxref{VC Directory Mode}). | ||
| 2080 | @end ifnottex | ||
| 2081 | Otherwise, just move to the beginning of the log. A numeric prefix | ||
| 2082 | argument is a repeat count, so @kbd{C-u 10 P} would move backward 10 | ||
| 2083 | files. | ||
| 2084 | 2067 | ||
| 2085 | @item N | 2068 | @item N |
| 2086 | Move to the log of the next file, when the logs of multiple files are | 2069 | Move to the log of the next file, when the logs of multiple files are |
| 2087 | in the log buffer | 2070 | in the log buffer (@pxref{VC Directory Mode}). It also takes a |
| 2088 | @iftex | 2071 | numeric prefix argument as a repeat count. |
| 2089 | (@pxref{VC Directory Mode,,,emacs-xtra, Specialized Emacs Features}). | ||
| 2090 | @end iftex | ||
| 2091 | @ifnottex | ||
| 2092 | (@pxref{VC Directory Mode}). | ||
| 2093 | @end ifnottex | ||
| 2094 | It also takes a numeric prefix argument as a repeat count. | ||
| 2095 | 2072 | ||
| 2096 | @item a | 2073 | @item a |
| 2097 | Annotate the revision indicated by the current line. | 2074 | Annotate the revision indicated by the current line. |
| @@ -2133,12 +2110,12 @@ This undoes your last check-in. | |||
| 2133 | @kindex C-x v u | 2110 | @kindex C-x v u |
| 2134 | @findex vc-revert-buffer | 2111 | @findex vc-revert-buffer |
| 2135 | If you want to discard your current set of changes and revert to the | 2112 | If you want to discard your current set of changes and revert to the |
| 2136 | working revision from which you started editing the file, use @kbd{C-x v u} | 2113 | working revision from which you started editing the file, use @kbd{C-x |
| 2137 | (@code{vc-revert-buffer}). This leaves the file unlocked; if locking | 2114 | v u} (@code{vc-revert-buffer}). If the version control system is |
| 2138 | is in use, you must first lock the file again before you change it | 2115 | locking-based, this leaves the file unlocked, and you must lock it |
| 2139 | again. @kbd{C-x v u} requires confirmation, unless it sees that you | 2116 | again before making new changes. @kbd{C-x v u} requires confirmation, |
| 2140 | haven't made any changes with respect to the master copy of the | 2117 | unless it sees that you haven't made any changes with respect to the |
| 2141 | working revision. | 2118 | master copy of the working revision. |
| 2142 | 2119 | ||
| 2143 | @kbd{C-x v u} is also the command to unlock a file if you lock it and | 2120 | @kbd{C-x v u} is also the command to unlock a file if you lock it and |
| 2144 | then decide not to change it. | 2121 | then decide not to change it. |
| @@ -2148,17 +2125,173 @@ then decide not to change it. | |||
| 2148 | To cancel a change that you already checked in, use @kbd{C-x v c} | 2125 | To cancel a change that you already checked in, use @kbd{C-x v c} |
| 2149 | (@code{vc-rollback}). This command discards all record of the most | 2126 | (@code{vc-rollback}). This command discards all record of the most |
| 2150 | recent checked-in revision, but only if your work file corresponds to | 2127 | recent checked-in revision, but only if your work file corresponds to |
| 2151 | that revision---you cannot use @kbd{C-x v c} to cancel a revision that is | 2128 | that revision---you cannot use @kbd{C-x v c} to cancel a revision that |
| 2152 | not the latest on its branch. Note that many version-control systems do | 2129 | is not the latest on its branch. Note that many version control |
| 2153 | not support rollback at all; this command is something of a historical | 2130 | systems do not support rollback at all; this command is something of a |
| 2154 | relic. | 2131 | historical relic. |
| 2132 | |||
| 2133 | @node VC Directory Mode | ||
| 2134 | @subsection VC Directory Mode | ||
| 2135 | |||
| 2136 | @kindex C-x v d | ||
| 2137 | @findex vc-dir | ||
| 2138 | When you are working on a large program, it is often useful to find | ||
| 2139 | out which files have changed within an entire directory tree, or to | ||
| 2140 | view the status of all files under version control at once, and to | ||
| 2141 | perform version control operations on collections of files. You can | ||
| 2142 | use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory | ||
| 2143 | listing that includes only files relevant for version control. This | ||
| 2144 | creates a @dfn{VC Directory buffer} and displays it in a separate | ||
| 2145 | window. | ||
| 2146 | |||
| 2147 | @cindex PCL-CVS | ||
| 2148 | @pindex cvs | ||
| 2149 | @cindex CVS directory mode | ||
| 2150 | The VC Directory buffer described here works with all the version | ||
| 2151 | control systems that VC supports. Another more powerful facility, | ||
| 2152 | designed specifically for CVS, is called PCL-CVS. @xref{Top, , About | ||
| 2153 | PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. | ||
| 2154 | |||
| 2155 | The VC Directory buffer contains a list of version-controlled files | ||
| 2156 | in the current directory and its subdirectories. Files which are | ||
| 2157 | up-to-date (have no local differences from the repository copy) are | ||
| 2158 | omitted; if all files in a directory are up-to-date, the directory is | ||
| 2159 | omitted as well. (However, the directory in which @code{vc-dir} was | ||
| 2160 | run will always be shown as @file{./}.) There is an exception to this | ||
| 2161 | rule: if VC mode detects that a file has changed to an up-to-date | ||
| 2162 | state since you last looked at it, that file and its state are shown. | ||
| 2163 | |||
| 2164 | If a directory uses more that one version control system, you can | ||
| 2165 | select which system to use for the @code{vc-dir} command by invoking | ||
| 2166 | @code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}. | ||
| 2167 | |||
| 2168 | The line for an individual file shows the version control state of | ||
| 2169 | the file. Under RCS and SCCS, the name of the user locking the file | ||
| 2170 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 2171 | output is used. Here is an example using CVS: | ||
| 2155 | 2172 | ||
| 2156 | @ifnottex | 2173 | @smallexample |
| 2157 | @c vc1-xtra.texi needs extra level of lowering. | 2174 | @group |
| 2158 | @lowersections | 2175 | ./ |
| 2159 | @include vc1-xtra.texi | 2176 | modified file1.c |
| 2160 | @raisesections | 2177 | needs-update file2.c |
| 2161 | @end ifnottex | 2178 | needs-merge file3.c |
| 2179 | @end group | ||
| 2180 | @end smallexample | ||
| 2181 | |||
| 2182 | @noindent | ||
| 2183 | In this example, @samp{file1.c} is modified with respect to the | ||
| 2184 | repository, and @samp{file2.c} is not. @samp{file3.c} is modified, | ||
| 2185 | but other changes have also been checked in to the repository---you | ||
| 2186 | need to merge them with the work file before you can check it in. | ||
| 2187 | |||
| 2188 | @vindex vc-stay-local | ||
| 2189 | @vindex vc-cvs-stay-local | ||
| 2190 | In the above, if the repository were on a remote machine, VC only | ||
| 2191 | contacts it when the variable @code{vc-stay-local} (or | ||
| 2192 | @code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is | ||
| 2193 | because access to the repository may be slow, or you may be working | ||
| 2194 | offline and not have access to the repository at all. As a | ||
| 2195 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 2196 | in the ``merge'' state; you would learn that only when you try to | ||
| 2197 | check-in your modified copy of the file, or use a command such as | ||
| 2198 | @kbd{C-x v m}. | ||
| 2199 | |||
| 2200 | In practice, this is not a problem because CVS handles this case | ||
| 2201 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 2202 | merge the remote changes into your work file first. The benefits of | ||
| 2203 | less network communication usually outweigh the disadvantage of not | ||
| 2204 | seeing remote changes immediately. | ||
| 2205 | |||
| 2206 | @vindex vc-directory-exclusion-list | ||
| 2207 | When a VC directory displays subdirectories it omits some that | ||
| 2208 | should never contain any files under version control. By default, | ||
| 2209 | this includes Version Control subdirectories such as @samp{RCS} and | ||
| 2210 | @samp{CVS}; you can customize this by setting the variable | ||
| 2211 | @code{vc-directory-exclusion-list}. | ||
| 2212 | |||
| 2213 | @menu | ||
| 2214 | * VC Directory Commands:: Commands to use in a VC directory buffer. | ||
| 2215 | @end menu | ||
| 2216 | |||
| 2217 | @node VC Directory Commands | ||
| 2218 | @subsubsection VC Directory Commands | ||
| 2219 | |||
| 2220 | VC Directory mode has a full set of navigation and marking commands | ||
| 2221 | for picking out filesets. Some of these are also available in a | ||
| 2222 | context menu invoked by the @kbd{mouse-2} button. | ||
| 2223 | |||
| 2224 | Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also | ||
| 2225 | move vertically as in other list-browsing modes. @key{SPC} and | ||
| 2226 | @key{TAB} behave like down-arrow, and @key{BackTab} behaves like | ||
| 2227 | up-arrow. | ||
| 2228 | |||
| 2229 | Both @kbd{C-m} and @kbd{f} visit the file on the current | ||
| 2230 | line. @kbd{o} visits that file in another window. @kbd{q} dismisses | ||
| 2231 | the directory buffer. | ||
| 2232 | |||
| 2233 | @kbd{x} toggles hiding of up-to-date files. | ||
| 2234 | |||
| 2235 | @kbd{m} marks the file or directory on the current line. If the | ||
| 2236 | region is active, @kbd{m} marks all the files in the region. There | ||
| 2237 | are some restrictions when marking: a file cannot be marked if any of | ||
| 2238 | its parent directories are marked, and a directory cannot be marked if | ||
| 2239 | any files in it or in its child directories are marked. | ||
| 2240 | |||
| 2241 | @kbd{M} marks all the files with the same VC state as the current | ||
| 2242 | file if the cursor is on a file. If the cursor is on a directory, it | ||
| 2243 | marks all child files. With a prefix argument: marks all files and | ||
| 2244 | directories. | ||
| 2245 | |||
| 2246 | @kbd{u} unmarks the file or directory on the current line. If the | ||
| 2247 | region is active, it unmarks all the files in the region. | ||
| 2248 | |||
| 2249 | @kbd{U} marks all the files with the same VC state as the current file | ||
| 2250 | if the cursor is on a file. If the cursor is on a directory, it | ||
| 2251 | unmarks all child files. With a prefix argument: unmarks all marked | ||
| 2252 | files and directories. | ||
| 2253 | |||
| 2254 | It is possible to do search, search and replace, incremental search, | ||
| 2255 | and incremental regexp search on multiple files. These commands will | ||
| 2256 | work on all the marked files or the current file if nothing is marked. | ||
| 2257 | If a directory is marked, the files in that directory shown in the VC | ||
| 2258 | directory buffer will be used. | ||
| 2259 | |||
| 2260 | @kbd{S} searches the marked files. | ||
| 2261 | |||
| 2262 | @kbd{Q} does a query replace on the marked files. | ||
| 2263 | |||
| 2264 | @kbd{M-s a C-s} does an incremental search on the marked files. | ||
| 2265 | |||
| 2266 | @kbd{M-s a C-M-s} does an incremental search on the marked files. | ||
| 2267 | |||
| 2268 | Commands are also accessible from the VC-dir menu. Note that some VC | ||
| 2269 | backends use the VC-dir menu to make available extra backend specific | ||
| 2270 | commands. | ||
| 2271 | |||
| 2272 | Normal VC commands with the @kbd{C-x v} prefix work in VC directory | ||
| 2273 | buffers. Some single-key shortcuts are available as well; @kbd{=}, | ||
| 2274 | @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with | ||
| 2275 | @kbd{C-x v}. | ||
| 2276 | |||
| 2277 | The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the | ||
| 2278 | marked files, so that you can check in several files at once. | ||
| 2279 | If the underlying VC supports atomic commits of multiple-file | ||
| 2280 | changesets, @kbd{C-x v v} with a selected set of modified but not | ||
| 2281 | committed files will commit all of them at once as a single changeset. | ||
| 2282 | |||
| 2283 | When @kbd{C-x v v} (@code{vc-next-action}) operates on a set of files, | ||
| 2284 | it requires that all of those files must be either in the same state or | ||
| 2285 | in compatible states; otherwise it will throw an error (added, | ||
| 2286 | modified and removed states are considered compatible). Note that this | ||
| 2287 | differs from the behavior of older versions of VC, which did not have | ||
| 2288 | fileset operations and simply did @code{vc-next-action} on each file | ||
| 2289 | individually. | ||
| 2290 | |||
| 2291 | If any files are in a state that calls for commit, @kbd{C-x v v} reads a | ||
| 2292 | single log entry and uses it for the changeset as a whole. If the | ||
| 2293 | underling VCS is file- rather than changeset-oriented, the log entry | ||
| 2294 | will be replicated into the history of each file. | ||
| 2162 | 2295 | ||
| 2163 | @node Branches | 2296 | @node Branches |
| 2164 | @subsection Multiple Branches of a File | 2297 | @subsection Multiple Branches of a File |
| @@ -2372,7 +2505,7 @@ branch ID. This ensures that Emacs knows which branch it is using | |||
| 2372 | during this particular editing session. | 2505 | during this particular editing session. |
| 2373 | 2506 | ||
| 2374 | @ifnottex | 2507 | @ifnottex |
| 2375 | @include vc2-xtra.texi | 2508 | @include vc1-xtra.texi |
| 2376 | @end ifnottex | 2509 | @end ifnottex |
| 2377 | 2510 | ||
| 2378 | @node Directories | 2511 | @node Directories |
| @@ -3083,8 +3216,8 @@ menu, where each existing fileset is represented by a submenu. | |||
| 3083 | 3216 | ||
| 3084 | Emacs uses the concept of a fileset elsewhere @pxref{Version | 3217 | Emacs uses the concept of a fileset elsewhere @pxref{Version |
| 3085 | Control} to describe sets of files to be treated as a group for | 3218 | Control} to describe sets of files to be treated as a group for |
| 3086 | purposes of version-control operations. Those filesets are | 3219 | purposes of version control operations. Those filesets are unnamed |
| 3087 | unnamed and do not persist across Emacs sessions. | 3220 | and do not persist across Emacs sessions. |
| 3088 | 3221 | ||
| 3089 | @ignore | 3222 | @ignore |
| 3090 | arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250 | 3223 | arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250 |