aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2007-10-10 23:22:48 +0000
committerEric S. Raymond2007-10-10 23:22:48 +0000
commita7fc5b7849de0514a0f250ebaa4b18f0ed29fc4d (patch)
treeb4e8f6c013b6e82170f7d99e79bd6b0e17930789
parent4413314af404d6999d43dd1dfe38428e245fdcd5 (diff)
downloademacs-a7fc5b7849de0514a0f250ebaa4b18f0ed29fc4d.tar.gz
emacs-a7fc5b7849de0514a0f250ebaa4b18f0ed29fc4d.zip
Revise version-control portions of the manual to include
systems with monotonic revision IDs.
-rw-r--r--doc/emacs/ChangeLog1
-rw-r--r--doc/emacs/files.texi174
-rw-r--r--doc/emacs/vc2-xtra.texi4
3 files changed, 106 insertions, 73 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 531d6859316..89e68f64b4b 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -5,6 +5,7 @@
5 * vc1-xtra.texi: 5 * vc1-xtra.texi:
6 * vc2-xtra.texi: Merge in changes for new VC with fileset-oriented 6 * vc2-xtra.texi: Merge in changes for new VC with fileset-oriented
7 operations. Change of terminology from 'version' to `revision'. 7 operations. Change of terminology from 'version' to `revision'.
8 Revise text for adequate description of VCSes with monotonic IDs.
8 * emacs.texi: Change of terminology from 'version' to `revision'. 9 * emacs.texi: Change of terminology from 'version' to `revision'.
9 10
102007-10-09 Eric S. Raymond <esr@snark.thyrsus.com> 112007-10-09 Eric S. Raymond <esr@snark.thyrsus.com>
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 20460993f5d..0e088a5a701 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1387,11 +1387,22 @@ revision.
1387 1387
1388@cindex work file 1388@cindex work file
1389@cindex checking out files 1389@cindex checking out files
1390 A file checked out of a version-control repository is sometimes called 1390 A file checked out of a version-control repository is sometimes
1391the @dfn{work file}. You edit the work file and make changes in it, as 1391called the @dfn{work file}. You edit the work file and make changes
1392you would with an ordinary file. After you are done with a set of 1392in it, as you would with an ordinary file. After you are done with a
1393changes, you @dfn{check the file in}, which records the changes in the 1393set of changes, you @dfn{check in} or @dfn{commit} the file, which
1394repository, along with a log entry for them. 1394records the changes in the repository, along with a log entry for
1395them.
1396
1397@cindex revision
1398@cindex revision ID
1399 A copy of a file stored in a repository is called a @dfn{revision}.
1400The history of a file is a sequence of revisions. Each revisions is
1401named by a @dfn{revision ID}. In older VCSes (such as SCCS and RCS),
1402the simplest kind of revision ID consisted of a @dfn{dot-pair};
1403integers (the @dfn{major} and @dfn{minor} revisions) separated by a
1404dot. Newer VCSes tend to use @dfn{monotonic} revision IDs that are
1405simple integers counting from 1.
1395 1406
1396 To go beyond these basic concepts, you will need to understand three 1407 To go beyond these basic concepts, you will need to understand three
1397ways in which version-control systems can differ from each other. They 1408ways in which version-control systems can differ from each other. They
@@ -1429,14 +1440,15 @@ happen when you check in a change to a file that conflicts with a change
1429checked in by someone else after your checkout. Both kinds of conflict 1440checked in by someone else after your checkout. Both kinds of conflict
1430have to be resolved by human judgment and communication. 1441have to be resolved by human judgment and communication.
1431 1442
1432 SCCS always uses locking. RCS is lock-based by default but can be told 1443 SCCS always uses locking. RCS is lock-based by default but can be
1433to operate in a merging style. CVS is merge-based by default but can 1444told to operate in a merging style. CVS and Subversion are
1434be told to operate in a locking mode. Most later version-control 1445merge-based by default but can be told to operate in a locking mode.
1435systems, such as Subversion and GNU Arch, have been fundamentally 1446Most later version-control systems, such as GNU Arch, git, and
1436merging-based rather than locking-based. This is because experience 1447Mercurial, have been fundamentally merging-based rather than
1437has shown that the merging-based approach is generally superior to 1448locking-based. This is because experience has shown that the
1438the locking one, both in convenience to developers and in minimizing 1449merging-based approach is generally superior to the locking one, both
1439the number and severity of conflicts that actually occur. 1450in convenience to developers and in minimizing the number and severity
1451of conflicts that actually occur.
1440 1452
1441 While it is rather unlikely that anyone will ever again build a 1453 While it is rather unlikely that anyone will ever again build a
1442fundamentally locking-based rather than merging-based version-control 1454fundamentally locking-based rather than merging-based version-control
@@ -1483,12 +1495,12 @@ single point of failure--if the repository server is down all work
1483stops. The other is that you need to be connected live to the server to 1495stops. The other is that you need to be connected live to the server to
1484do checkins and checkouts; if you're offline, you can't work. 1496do checkins and checkouts; if you're offline, you can't work.
1485 1497
1486 Newer version-control systems like GNU Arch are @dfn{decentralized}. 1498 Newer version-control systems like GNU Arch, git, Mercurial, and Bzr
1487A project may have several different repositories, and these systems 1499are @dfn{decentralized}. A project may have several different
1488support a sort of super-merge between repositories that tries to 1500repositories, and these systems support a sort of super-merge between
1489reconcile their change histories. At the limit, each developer has 1501repositories that tries to reconcile their change histories. At the
1490his/her own repository, and repository merges replace checkin/commit 1502limit, each developer has his/her own repository, and repository
1491operations. 1503merges replace checkin/commit operations.
1492 1504
1493 VC's job is to help you manage the traffic between your personal 1505 VC's job is to help you manage the traffic between your personal
1494workfiles and a repository. Whether that repository is a single master 1506workfiles and a repository. Whether that repository is a single master
@@ -1561,7 +1573,7 @@ to copy it to @file{ChangeLog}
1561this on the mode line. For example, @samp{RCS-1.3} says that RCS is 1573this on the mode line. For example, @samp{RCS-1.3} says that RCS is
1562used for that file, and the current version is 1.3. 1574used for that file, and the current version is 1.3.
1563 1575
1564 The character between the back-end name and the version number 1576 The character between the back-end name and the revision ID
1565indicates the version control status of the file. @samp{-} means that 1577indicates the version control status of the file. @samp{-} means that
1566the work file is not locked (if locking is in use), or not modified (if 1578the work file is not locked (if locking is in use), or not modified (if
1567locking is not in use). @samp{:} indicates that the file is locked, or 1579locking is not in use). @samp{:} indicates that the file is locked, or
@@ -1608,7 +1620,7 @@ are visiting a VC Dired buffer, and some files in it are marked,
1608your fileset is the marked files only. 1620your fileset is the marked files only.
1609 1621
1610 All files in a fileset must be under the same version-control system. 1622 All files in a fileset must be under the same version-control system.
1611If they are not, VC mode wil throw an error when you attempt to execute 1623If they are not, VC mode will throw an error when you attempt to execute
1612a command on the fileset. 1624a command on the fileset.
1613 1625
1614 Filesets, are, essentially, a way to pass multiple file arguments as 1626 Filesets, are, essentially, a way to pass multiple file arguments as
@@ -1618,13 +1630,14 @@ joint commit, as though you had typed @command{svn
1618commit} with those file arguments at the shell command line in the 1630commit} with those file arguments at the shell command line in the
1619directory of the selected buffer. 1631directory of the selected buffer.
1620 1632
1621 If you are used to earlier versions of VC, the change in behavior you 1633 If you are used to earlier versions of VC, the change in behavior
1622will notice is in VC-Dired mode. Other than @kbd{C-x v v}, most VC-mode 1634you will notice is in VC-Dired mode. Other than @kbd{C-x v v}, most
1623commands used to operate on only one file selected by the line the 1635VC-mode commands used to operate on only one file selected by the line
1624cursor is on. The change in the behavior of @kbd{C-x v v} is more 1636the cursor is on. The change in the behavior of @kbd{C-x v v} outside
1625subtle. Formerly it operated in parallel on all marked files, but did 1637VC-Dired mode is more subtle. Formerly it operated in parallel on all
1626not pass them to the version-control backends as a group. Now it does, 1638marked files, but did not pass them to the version-control backends as
1627which enables VC to drive changeset-based version-control systems. 1639a group. Now it does, which enables VC to drive changeset-based
1640version-control systems.
1628 1641
1629@node Doing the next logical thing 1642@node Doing the next logical thing
1630@subsubsection Performing the next operation in the development cycle 1643@subsubsection Performing the next operation in the development cycle
@@ -1691,10 +1704,11 @@ that there is no such thing as stealing a lock.
1691 1704
1692 When your version-control system is merging-based rather than 1705 When your version-control system is merging-based rather than
1693locking-based---the default for CVS and Subversion, and the way GNU 1706locking-based---the default for CVS and Subversion, and the way GNU
1694Arch always works---work files are always writable; you do not need to 1707Arch and more modern systems always work---work files are always
1695do anything before you begin to edit a file. The status indicator on 1708writable; you do not need to do anything before you begin to edit a
1696the mode line is @samp{-} if the file is unmodified; it flips to 1709file. The status indicator on the mode line is @samp{-} if the file
1697@samp{:} as soon as you save any changes in the work file. 1710is unmodified; it flips to @samp{:} as soon as you save any changes in
1711the work file.
1698 1712
1699 Here is what @kbd{C-x v v} does when using a merging-based system 1713 Here is what @kbd{C-x v v} does when using a merging-based system
1700(such as CVS or Subversion in their defaiult merging mode): 1714(such as CVS or Subversion in their defaiult merging mode):
@@ -1738,7 +1752,7 @@ changes in the repository automatically and notify you when they occur.
1738@node Advanced C-x v v 1752@node Advanced C-x v v
1739@subsubsection Advanced Control in @kbd{C-x v v} 1753@subsubsection Advanced Control in @kbd{C-x v v}
1740 1754
1741@cindex revision number to check in/out 1755@cindex revision ID to check in/out
1742 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u 1756 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
1743C-x v v}), it still performs the next logical version control 1757C-x v v}), it still performs the next logical version control
1744operation, but accepts additional arguments to specify precisely how 1758operation, but accepts additional arguments to specify precisely how
@@ -1760,7 +1774,7 @@ get the latest version of a file from the repository.
1760 1774
1761@item 1775@item
1762@cindex specific version control system 1776@cindex specific version control system
1763Instead of the version number, you can also specify the name of a 1777Instead of the revision ID, you can also specify the name of a
1764version control system. This is useful when one file is being managed 1778version control system. This is useful when one file is being managed
1765with two version control systems at the same time 1779with two version control systems at the same time
1766@iftex 1780@iftex
@@ -1856,8 +1870,8 @@ Examine revision @var{revision} of the visited file, in a buffer of its
1856own. 1870own.
1857 1871
1858@item C-x v = 1872@item C-x v =
1859Compare the buffer contents of the current 1873Compare the buffer contents associated with the current
1860fileset with the repository revision from which you started editing. 1874fileset with the working revision(s) from which you started editing.
1861 1875
1862@item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET} 1876@item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET}
1863Compare the specified two repository revisions of the current fileset. 1877Compare the specified two repository revisions of the current fileset.
@@ -1887,10 +1901,10 @@ in a special buffer in another window.
1887@kindex C-u C-x v = 1901@kindex C-u C-x v =
1888 You can compare two repository revisions of the current fileset with 1902 You can compare two repository revisions of the current fileset with
1889the command @kbd{C-u C-x v =} (@code{vc-diff}). @kbd{C-u C-x v =} reads 1903the command @kbd{C-u C-x v =} (@code{vc-diff}). @kbd{C-u C-x v =} reads
1890two revision numbers or tags. The diff will be displayed in a special 1904two revision ID or tags. The diff will be displayed in a special
1891buffer in another window. 1905buffer in another window.
1892 1906
1893 You can specify a checked-in revision by its number or ID; an empty input 1907 You can specify a checked-in revision by its ID; an empty input
1894specifies the current contents of the work file (which may be different 1908specifies the current contents of the work file (which may be different
1895from all the checked-in revisions). You can also specify a snapshot name 1909from all the checked-in revisions). You can also specify a snapshot name
1896@iftex 1910@iftex
@@ -1903,7 +1917,7 @@ instead of one or both revision ID.
1903 1917
1904 Note that if your version-control system is file-oriented (SCCS, RCS, 1918 Note that if your version-control system is file-oriented (SCCS, RCS,
1905CVS) rather than fileset-oriented (CVS, Subversion, GNU Arch) specifying 1919CVS) rather than fileset-oriented (CVS, Subversion, GNU Arch) specifying
1906a revision of a multiple-file fileset by number (as opposed to a snapshot 1920a revision of a multiple-file fileset by revision ID (as opposed to a snapshot
1907name or RSCCS/RCS tag) is unlikely to return diffs that are connected in 1921name or RSCCS/RCS tag) is unlikely to return diffs that are connected in
1908any meaningful way. 1922any meaningful way.
1909 1923
@@ -1942,7 +1956,7 @@ the color is scaled over the full range of ages, such that the oldest
1942changes are blue, and the newest changes are red. 1956changes are blue, and the newest changes are red.
1943 1957
1944 When you give a prefix argument to this command, it uses the 1958 When you give a prefix argument to this command, it uses the
1945minibuffer to read two arguments: which revision number to display and 1959minibuffer to read two arguments: the ID of which revision to display and
1946annotate (instead of the current file contents), and the time span in 1960annotate (instead of the current file contents), and the time span in
1947days the color range should cover. 1961days the color range should cover.
1948 1962
@@ -2039,12 +2053,14 @@ revision by typing @kbd{C-x v v}. Until you do that, the revision ID
2039appears as @samp{@@@@} in the mode line. 2053appears as @samp{@@@@} in the mode line.
2040 2054
2041@vindex vc-default-init-revision 2055@vindex vc-default-init-revision
2042@cindex initial revision number to register 2056@cindex initial revision ID to register
2043 The initial revision number for a newly registered file is 1.1, by 2057 The default initial revision ID for a newly registered file
2044default. You can specify a different default by setting the variable 2058varies by what VCS you are using; normally it will be 1.1 on VCSes
2045@code{vc-default-init-revision}, or you can give @kbd{C-x v i} a numeric 2059that use dot-pair revision IDs and 1 on VCSes that use monotonic IDs.
2046argument; then it reads the initial revision number for this particular 2060You can specify a different default by setting the variable
2047file using the minibuffer. 2061@code{vc-default-init-revision}, or you can give @kbd{C-x v i} a
2062numeric argument; then it reads the initial revision ID for this
2063particular file using the minibuffer.
2048 2064
2049@vindex vc-initial-comment 2065@vindex vc-initial-comment
2050 If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an 2066 If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an
@@ -2109,7 +2125,7 @@ It also takes a numeric prefix argument as a repeat count.
2109 2125
2110@item f 2126@item f
2111Visit the revision indicated at the current line, like typing @kbd{C-x 2127Visit the revision indicated at the current line, like typing @kbd{C-x
2112v ~} and specifying this revision's number (@pxref{Old Revisions}). 2128v ~} and specifying this revision's ID (@pxref{Old Revisions}).
2113 2129
2114@item d 2130@item d
2115Display the diff (@pxref{Comparing Files}) between the revision 2131Display the diff (@pxref{Comparing Files}) between the revision
@@ -2175,18 +2191,30 @@ different branches, and merge changes from one branch to another.
2175Please note, however, that branches are not supported for SCCS. 2191Please note, however, that branches are not supported for SCCS.
2176 2192
2177 A file's main line of development is usually called the @dfn{trunk}. 2193 A file's main line of development is usually called the @dfn{trunk}.
2178The revisions on the trunk are normally numbered 1.1, 1.2, 1.3, etc. At 2194You can create multiple branches from the trunk. How the difference
2179any such revision, you can start an independent branch. A branch 2195between trunk and branch is made visible is dependent on whether the
2180starting at revision 1.2 would have revision number 1.2.1.1, and consecutive 2196VCS uses dot-pair or monotonic version IDs.
2181revisions on this branch would have numbers 1.2.1.2, 1.2.1.3, 1.2.1.4, 2197
2182and so on. If there is a second branch also starting at revision 1.2, it 2198 In VCSes with dot-pair revision IDs, the revisions on the trunk are
2183would consist of revisions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc. 2199normally IDed 1.1, 1.2, 1.3, etc. At any such revision, you can
2200start an independent branch. A branch starting at revision 1.2 would
2201have revision ID 1.2.1.1, and consecutive revisions on this branch
2202would have IDs 1.2.1.2, 1.2.1.3, 1.2.1.4, and so on. If there is
2203a second branch also starting at revision 1.2, it would consist of
2204revisions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc.
2205
2206 In VCSes with monotonic revision IDs, trunk revisions are IDed as
22071, 2, 3, etc. A branch from (say) revision 2 might start with 2.1 and
2208continue through 2.2, 2.3, etc. But naming conventions for branches
2209and subbranches vary widely on these systems, and some (like
2210Mercurial) never depart from the monotonic integer sequence at all.
2211Consult the documentation of the VCS you are using.
2184 2212
2185@cindex head revision 2213@cindex head revision
2186 If you omit the final component of a revision number, that is called a 2214 If you omit the final component of a dot-pair revision ID, that is called a
2187@dfn{branch number}. It refers to the highest existing revision on that 2215@dfn{branch ID}. It refers to the highest existing revision on that
2188branch---the @dfn{head revision} of that branch. The branches in the 2216branch---the @dfn{head revision} of that branch. The branches in the
2189example above have branch numbers 1.2.1 and 1.2.2. 2217dot-pair example above have branch IDs 1.2.1 and 1.2.2.
2190 2218
2191@menu 2219@menu
2192* Switching Branches:: How to get to another existing branch. 2220* Switching Branches:: How to get to another existing branch.
@@ -2205,10 +2233,10 @@ version is then visited @emph{unlocked} (write-protected), so you can
2205examine it before locking it. Switching branches in this way is allowed 2233examine it before locking it. Switching branches in this way is allowed
2206only when the file is not locked. 2234only when the file is not locked.
2207 2235
2208 On a VS with RCS-like revision numbering, you can omit the minor 2236 On a VCS with dot-pair IDs, you can omit the minor part, thus giving
2209revision number, thus giving only the branch number; this takes you to 2237only the branch ID; this takes you to the head version on the
2210the head version on the chosen branch. If you only type @key{RET}, 2238chosen branch. If you only type @key{RET}, Emacs goes to the highest
2211Emacs goes to the highest version on the trunk. 2239version on the trunk.
2212 2240
2213 After you have switched to any branch (including the main branch), you 2241 After you have switched to any branch (including the main branch), you
2214stay on it for subsequent VC commands, until you explicitly select some 2242stay on it for subsequent VC commands, until you explicitly select some
@@ -2221,9 +2249,9 @@ other branch.
2221the branch that contains it), first select that revision if necessary, 2249the branch that contains it), first select that revision if necessary,
2222lock it with @kbd{C-x v v}, and make whatever changes you want. Then, 2250lock it with @kbd{C-x v v}, and make whatever changes you want. Then,
2223when you check in the changes, use @kbd{C-u C-x v v}. This lets you 2251when you check in the changes, use @kbd{C-u C-x v v}. This lets you
2224specify the revision number for the new revision. You should specify a 2252specify the revision ID for the new revision. You should specify a
2225suitable branch number for a branch starting at the current revision. 2253suitable branch ID for a branch starting at the current revision.
2226For example, if the current revision is 2.5, the branch number should be 2254For example, if the current revision is 2.5, the branch ID should be
22272.5.1, 2.5.2, and so on, depending on the number of existing branches at 22552.5.1, 2.5.2, and so on, depending on the number of existing branches at
2228that point. 2256that point.
2229 2257
@@ -2276,7 +2304,7 @@ since you checked the file out (we call this @dfn{merging the news}).
2276This is the common way to pick up recent changes from the repository, 2304This is the common way to pick up recent changes from the repository,
2277regardless of whether you have already changed the file yourself. 2305regardless of whether you have already changed the file yourself.
2278 2306
2279 You can also enter a branch number or a pair of revision numbers in 2307 You can also enter a branch ID or a pair of revision IDs in
2280the minibuffer. Then @kbd{C-x v m} finds the changes from that 2308the minibuffer. Then @kbd{C-x v m} finds the changes from that
2281branch, or the differences between the two revisions you specified, and 2309branch, or the differences between the two revisions you specified, and
2282merges them into the current revision of the current file. 2310merges them into the current revision of the current file.
@@ -2336,12 +2364,12 @@ check in the merged version afterwards.
2336@subsubsection Multi-User Branching 2364@subsubsection Multi-User Branching
2337 2365
2338 It is often useful for multiple developers to work simultaneously on 2366 It is often useful for multiple developers to work simultaneously on
2339different branches of a file. CVS allows this by default; for RCS, it 2367different branches of a file. CVS and later systems allow this by
2340is possible if you create multiple source directories. Each source 2368default; for RCS, it is possible if you create multiple source
2341directory should have a link named @file{RCS} which points to a common 2369directories. Each source directory should have a link named
2342directory of RCS master files. Then each source directory can have its 2370@file{RCS} which points to a common directory of RCS master files.
2343own choice of selected revisions, but all share the same common RCS 2371Then each source directory can have its own choice of selected
2344records. 2372revisions, but all share the same common RCS records.
2345 2373
2346 This technique works reliably and automatically, provided that the 2374 This technique works reliably and automatically, provided that the
2347source files contain RCS version headers 2375source files contain RCS version headers
@@ -2351,13 +2379,13 @@ source files contain RCS version headers
2351@ifnottex 2379@ifnottex
2352(@pxref{Version Headers}). 2380(@pxref{Version Headers}).
2353@end ifnottex 2381@end ifnottex
2354The headers enable Emacs to be sure, at all times, which version 2382The headers enable Emacs to be sure, at all times, which revision
2355number is present in the work file. 2383ID is present in the work file.
2356 2384
2357 If the files do not have version headers, you must instead tell Emacs 2385 If the files do not have version headers, you must instead tell Emacs
2358explicitly in each session which branch you are working on. To do this, 2386explicitly in each session which branch you are working on. To do this,
2359first find the file, then type @kbd{C-u C-x v v} and specify the correct 2387first find the file, then type @kbd{C-u C-x v v} and specify the correct
2360branch number. This ensures that Emacs knows which branch it is using 2388branch ID. This ensures that Emacs knows which branch it is using
2361during this particular editing session. 2389during this particular editing session.
2362 2390
2363@ifnottex 2391@ifnottex
diff --git a/doc/emacs/vc2-xtra.texi b/doc/emacs/vc2-xtra.texi
index a4ef91c74f4..da7ef76025a 100644
--- a/doc/emacs/vc2-xtra.texi
+++ b/doc/emacs/vc2-xtra.texi
@@ -21,6 +21,10 @@ third-generation decentralized VCses such as GNU Arch or Mercurial
21really solve this problem, VC is designed to reduce the amount of 21really solve this problem, VC is designed to reduce the amount of
22network interaction necessary. 22network interaction necessary.
23 23
24 If you are using a truly decentralized VCS you can skip the rest of
25this section. It describes backup and local-repository techniques
26that are only useful for Subversion and earlier VCSes.
27
24@menu 28@menu
25* Version Backups:: Keeping local copies of repository versions. 29* Version Backups:: Keeping local copies of repository versions.
26* Local Version Control:: Using another version system for local editing. 30* Local Version Control:: Using another version system for local editing.