Mercurial > emacs
comparison man/files.texi @ 36385:d7ca85bd6906
Clean up recent VC updates.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 25 Feb 2001 17:24:19 +0000 |
parents | 0774daebf700 |
children | e06c9b1a0b04 |
comparison
equal
deleted
inserted
replaced
36384:f9e19fa8951a | 36385:d7ca85bd6906 |
---|---|
1059 versions of a source file, usually storing the unchanged parts of the | 1059 versions of a source file, usually storing the unchanged parts of the |
1060 file just once. Version control systems also record history information | 1060 file just once. Version control systems also record history information |
1061 such as the creation time of each version, who created it, and a | 1061 such as the creation time of each version, who created it, and a |
1062 description of what was changed in that version. | 1062 description of what was changed in that version. |
1063 | 1063 |
1064 The Emacs version control interface is called VC. It allows you to | 1064 The Emacs version control interface is called VC. Its commands work |
1065 use various version control systems from within | 1065 with three version control systems---RCS, CVS, and SCCS. The GNU |
1066 Emacs---currently, it supports RCS, CVS, and SCCS. The GNU | |
1067 project recommends RCS and CVS, which are free software and available | 1066 project recommends RCS and CVS, which are free software and available |
1068 from the Free Software Foundation. We also have free software to | 1067 from the Free Software Foundation. We also have free software to |
1069 replace SCCS, known as CSSC; if you are using SCCS and don't want to | 1068 replace SCCS, known as CSSC; if you are using SCCS and don't want to |
1070 make the incompatible change to RCS or CVS, you can switch to CSSC. | 1069 make the incompatible change to RCS or CVS, you can switch to CSSC. |
1071 | 1070 |
1224 RCS normally use locking; CVS normally does not use locking. | 1223 RCS normally use locking; CVS normally does not use locking. |
1225 | 1224 |
1226 @menu | 1225 @menu |
1227 * VC with Locking:: RCS in its default mode, SCCS, and optionally CVS. | 1226 * VC with Locking:: RCS in its default mode, SCCS, and optionally CVS. |
1228 * Without Locking:: Without locking: default mode for CVS. | 1227 * Without Locking:: Without locking: default mode for CVS. |
1229 * Extended Actions:: Avanced features available with a prefix argument. | 1228 * Extended C-x C-q:: Advanced features available with a prefix argument. |
1230 * Log Buffer:: Features available in log entry buffers. | 1229 * Log Buffer:: Features available in log entry buffers. |
1231 @end menu | 1230 @end menu |
1232 | 1231 |
1233 @node VC with Locking | 1232 @node VC with Locking |
1234 @subsubsection Basic Version Control with Locking | 1233 @subsubsection Basic Version Control with Locking |
1272 | 1271 |
1273 Here is what @kbd{C-x C-q} does when using CVS: | 1272 Here is what @kbd{C-x C-q} does when using CVS: |
1274 | 1273 |
1275 @itemize @bullet | 1274 @itemize @bullet |
1276 @item | 1275 @item |
1277 If some other user has checked in changes into the master file, | 1276 If some other user has checked in changes into the master file, Emacs |
1278 Emacs asks you whether you want to merge those changes into your own | 1277 asks you whether you want to merge those changes into your own work |
1279 work file. You must do this before you can check in | 1278 file. You must do this before you can check in your own changes. (To |
1280 your own changes. (To pick up any recent changes from the master file | 1279 pick up any recent changes from the master file @emph{without} trying |
1281 @emph{without} trying to commit your own changes, type @kbd{C-x v m RET}.) | 1280 to commit your own changes, type @kbd{C-x v m @key{RET}}.) |
1282 @xref{Merging}. | 1281 @xref{Merging}. |
1283 | 1282 |
1284 @item | 1283 @item |
1285 If there are no new changes in the master file, but you have made | 1284 If there are no new changes in the master file, but you have made |
1286 modifications in your work file, @kbd{C-x C-q} checks in your changes. | 1285 modifications in your work file, @kbd{C-x C-q} checks in your changes. |
1304 | 1303 |
1305 In addition, locking is possible with RCS even in this mode, although | 1304 In addition, locking is possible with RCS even in this mode, although |
1306 it is not required; @kbd{C-x C-q} with an unmodified file locks the | 1305 it is not required; @kbd{C-x C-q} with an unmodified file locks the |
1307 file, just as it does with RCS in its normal (locking) mode. | 1306 file, just as it does with RCS in its normal (locking) mode. |
1308 | 1307 |
1309 @node Extended Actions | 1308 @node Advanced C-x C-q |
1310 @subsubsection Calling @code{vc-next-action} with a Prefix Argument | 1309 @subsubsection Advanced Control in @kbd{C-x C-q} |
1311 | 1310 |
1312 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u C-x | 1311 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u |
1313 C-q}), it still performs the next logical version control operation, but | 1312 C-x C-q}), it still performs the next logical version control |
1314 in an extended sense. | 1313 operation, but accepts additional arguments to specify precisely how |
1314 to do the operation. | |
1315 | 1315 |
1316 @itemize @bullet | 1316 @itemize @bullet |
1317 @item If the file is modified (or locked), you can specify the version | 1317 @item |
1318 number that should be used for check-in. This is also one way to create | 1318 If the file is modified (or locked), you can specify the version |
1319 a new branch (@pxref{Branches}). | 1319 number to use for the new verion that you check-in. This is one way |
1320 | 1320 to create a new branch (@pxref{Branches}). |
1321 @item If the file is not modified (and unlocked), you can specify a new | 1321 |
1322 version to go to; this lets you start working from an older version, or | 1322 @item |
1323 on another branch. If you do not enter any version, that takes you to | 1323 If the file is not modified (and unlocked), you can specify the |
1324 the highest version on the current branch; therefore @kbd{C-u C-x C-q | 1324 version to select; this lets you start working from an older version, |
1325 RET} is a convenient way to get the latest version of a file from the | 1325 or on another branch. If you do not enter any version, that takes you |
1326 repository. | 1326 to the highest version on the current branch; therefore @kbd{C-u C-x |
1327 | 1327 C-q @key{RET}} is a convenient way to get the latest version of a file from |
1328 @item Regardless of the state of the file, you can also enter the name | 1328 the repository. |
1329 of another version control system instead of a version number. This | 1329 |
1330 lets you use more than one version control system for a file | 1330 @item |
1331 (@pxref{Local Version Control}). | 1331 Instead of the version number, you can also specify the name of a |
1332 version control system. This is useful when one file is being managed | |
1333 with two version control systems at the same time file (@pxref{Local | |
1334 Version Control}). | |
1332 @end itemize | 1335 @end itemize |
1333 | 1336 |
1334 @node Log Buffer | 1337 @node Log Buffer |
1335 @subsubsection Features of the Log Entry Buffer | 1338 @subsubsection Features of the Log Entry Buffer |
1336 | 1339 |
1391 @findex vc-diff | 1394 @findex vc-diff |
1392 @kindex C-x v = | 1395 @kindex C-x v = |
1393 It is usually more convenient to compare two versions of the file, | 1396 It is usually more convenient to compare two versions of the file, |
1394 with the command @kbd{C-x v =} (@code{vc-diff}). Plain @kbd{C-x v =} | 1397 with the command @kbd{C-x v =} (@code{vc-diff}). Plain @kbd{C-x v =} |
1395 compares the current buffer contents (saving them in the file if | 1398 compares the current buffer contents (saving them in the file if |
1396 necessary) with the last checked-in version of the file. @kbd{C-u C-x v | 1399 necessary) with the last checked-in version of the file. @kbd{C-u C-x |
1397 =}, with a numeric argument, reads a file name and two version numbers, | 1400 v =}, with a numeric argument, reads a file name and two version |
1398 then compares those versions of the specified file. | 1401 numbers, then compares those versions of the specified file. Both |
1399 | 1402 forms display the output in a special buffer in another window. |
1400 If you supply a directory name instead of the name of a registered | |
1401 file, this command compares the two specified versions of all registered | |
1402 files in that directory and its subdirectories. | |
1403 | 1403 |
1404 You can specify a checked-in version by its number; an empty input | 1404 You can specify a checked-in version by its number; an empty input |
1405 specifies the current contents of the work file (which may be different | 1405 specifies the current contents of the work file (which may be different |
1406 from all the checked-in versions). You can also specify a snapshot name | 1406 from all the checked-in versions). You can also specify a snapshot name |
1407 (@pxref{Snapshots}) instead of one or both version numbers. | 1407 (@pxref{Snapshots}) instead of one or both version numbers. |
1408 | 1408 |
1409 If you supply a directory name instead of the name of a registered | |
1410 file, this command compares the two specified versions of all registered | |
1411 files in that directory and its subdirectories. | |
1412 | |
1409 @vindex diff-switches | 1413 @vindex diff-switches |
1410 @vindex vc-diff-switches | 1414 @vindex vc-diff-switches |
1411 This command works by running a variant of the @code{diff} utility | 1415 @kbd{C-x v =} works by running a variant of the @code{diff} utility |
1412 that is specific to the version control system in use. Emacs passes the | 1416 designed to work with the version control system in use. Emacs passes |
1413 contents of the variable @code{diff-switches} to that utility; you can | 1417 the contents of the variable @code{diff-switches} to it; you can |
1414 define specific options for version control in @code{vc-diff-switches}, | 1418 specify comparison options for version control in |
1415 and there are similar variables for each specific system, | 1419 @code{vc-diff-switches}, and there are similar variables for each |
1416 e.g. @code{vc-rcs-diff-switches}, and the like. | 1420 specific system---@code{vc-rcs-diff-switches}, and so on. |
1417 | 1421 |
1418 The output of the @code{diff} command is displayed in a special buffer | 1422 Unlike the @kbd{M-x diff} command, @kbd{C-x v =} does not try to |
1419 in another window. Unlike the @kbd{M-x diff} command, @kbd{C-x v =} | 1423 locate the changes in the old and new versions. This is because |
1420 does not try to locate the changes in the old and new versions. This is | 1424 normally one or both versions do not exist as files when you compare |
1421 because normally one or both versions do not exist as files when you | 1425 them; they exist only in the records of the master file. |
1422 compare them; they exist only in the records of the master file. | |
1423 @xref{Comparing Files}, for more information about @kbd{M-x diff}. | 1426 @xref{Comparing Files}, for more information about @kbd{M-x diff}. |
1424 | 1427 |
1425 @findex vc-annotate | 1428 @findex vc-annotate |
1426 @kindex C-x v g | 1429 @kindex C-x v g |
1427 For CVS-controlled files, you can display the result of the CVS | 1430 For CVS-controlled files, you can display the result of the CVS |
1467 Emacs uses the first system from @var{vc-handled-backends} that could | 1470 Emacs uses the first system from @var{vc-handled-backends} that could |
1468 register the file---for example, you cannot register a file under CVS if | 1471 register the file---for example, you cannot register a file under CVS if |
1469 its directory is not already part of a CVS tree. | 1472 its directory is not already part of a CVS tree. |
1470 | 1473 |
1471 With the default value of @var{vc-handled-backends}, this means that | 1474 With the default value of @var{vc-handled-backends}, this means that |
1472 Emacs uses RCS if there are any files under RCS control, and CVS if | 1475 Emacs uses RCS if there are any files under RCS control, or CVS if |
1473 there are any files under CVS. If there are no files under version | 1476 there are any files under CVS, or RCS as the ultimate default. |
1474 control, RCS is used. | |
1475 | 1477 |
1476 If locking is in use, @kbd{C-x v i} leaves the file unlocked and | 1478 If locking is in use, @kbd{C-x v i} leaves the file unlocked and |
1477 read-only. Type @kbd{C-x C-q} if you wish to start editing it. After | 1479 read-only. Type @kbd{C-x C-q} if you wish to start editing it. After |
1478 registering a file with CVS, you must subsequently commit the initial | 1480 registering a file with CVS, you must subsequently commit the initial |
1479 version by typing @kbd{C-x C-q}. | 1481 version by typing @kbd{C-x C-q}. |
1720 it. Switching branches in this way is allowed only when the file is not | 1722 it. Switching branches in this way is allowed only when the file is not |
1721 locked. | 1723 locked. |
1722 | 1724 |
1723 You can omit the minor version number, thus giving only the branch | 1725 You can omit the minor version number, thus giving only the branch |
1724 number; this takes you to the head version on the chosen branch. If you | 1726 number; this takes you to the head version on the chosen branch. If you |
1725 only type @kbd{RET}, Emacs goes to the highest version on the trunk. | 1727 only type @key{RET}, Emacs goes to the highest version on the trunk. |
1726 | 1728 |
1727 After you have switched to any branch (including the main branch), you | 1729 After you have switched to any branch (including the main branch), you |
1728 stay on it for subsequent VC commands, until you explicitly select some | 1730 stay on it for subsequent VC commands, until you explicitly select some |
1729 other branch. | 1731 other branch. |
1730 | 1732 |
1779 @kindex C-x v m | 1781 @kindex C-x v m |
1780 @findex vc-merge | 1782 @findex vc-merge |
1781 @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it | 1783 @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it |
1782 into the current version of the work file. It firsts asks you in the | 1784 into the current version of the work file. It firsts asks you in the |
1783 minibuffer where the changes should come from. If you just type | 1785 minibuffer where the changes should come from. If you just type |
1784 @kbd{RET}, Emacs merges any changes that were made on the same branch | 1786 @key{RET}, Emacs merges any changes that were made on the same branch |
1785 since you checked the file out (we call this @dfn{merging the news}). | 1787 since you checked the file out (we call this @dfn{merging the news}). |
1786 This is the common way to pick up recent changes from the repository, | 1788 This is the common way to pick up recent changes from the repository, |
1787 regardless of whether you have already changed the file yourself. | 1789 regardless of whether you have already changed the file yourself. |
1788 | 1790 |
1789 You can also enter a branch number or a pair of version numbers in | 1791 You can also enter a branch number or a pair of version numbers in |
1793 | 1795 |
1794 As an example, suppose that you have finished a certain feature on | 1796 As an example, suppose that you have finished a certain feature on |
1795 branch 1.3.1. In the meantime, development on the trunk has proceeded | 1797 branch 1.3.1. In the meantime, development on the trunk has proceeded |
1796 to version 1.5. To merge the changes from the branch to the trunk, | 1798 to version 1.5. To merge the changes from the branch to the trunk, |
1797 first go to the head version of the trunk, by typing @kbd{C-u C-x C-q | 1799 first go to the head version of the trunk, by typing @kbd{C-u C-x C-q |
1798 RET}. Version 1.5 is now current. If locking is used for the file, | 1800 @key{RET}}. Version 1.5 is now current. If locking is used for the file, |
1799 type @kbd{C-x C-q} to lock version 1.5 so that you can change it. Next, | 1801 type @kbd{C-x C-q} to lock version 1.5 so that you can change it. Next, |
1800 type @kbd{C-x v m 1.3.1 RET}. This takes the entire set of changes on | 1802 type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on |
1801 branch 1.3.1 (relative to version 1.3, where the branch started, up to | 1803 branch 1.3.1 (relative to version 1.3, where the branch started, up to |
1802 the last version on the branch) and merges it into the current version | 1804 the last version on the branch) and merges it into the current version |
1803 of the work file. You can now check in the changed file, thus creating | 1805 of the work file. You can now check in the changed file, thus creating |
1804 version 1.6 containing the changes from the branch. | 1806 version 1.6 containing the changes from the branch. |
1805 | 1807 |
1865 | 1867 |
1866 @node Remote Repositories | 1868 @node Remote Repositories |
1867 @subsection Remote Repositories | 1869 @subsection Remote Repositories |
1868 @cindex remote repositories (CVS) | 1870 @cindex remote repositories (CVS) |
1869 | 1871 |
1870 Many projects set up a central CVS repository somewhere in the Internet, | 1872 A common way of using CVS is to set up a central CVS repository on |
1871 and let each user check out a personal working copy of the files to | 1873 some Internet host, then have each developer check out a personal |
1872 his local machine. Committing changes to the repository, and picking | 1874 working copy of the files on his local machine. Committing changes to |
1873 up changes from other users into one's own working area, then works by | 1875 the repository, and picking up changes from other users into one's own |
1874 direct interactions with the CVS server. | 1876 working area, then works by direct interactions with the CVS server. |
1875 | 1877 |
1876 The problem is that access to the CVS server is often slow, and that | 1878 One difficulty is that access to the CVS server is often slow, and |
1877 developers might need to work offline as well. VC therefore offers | 1879 that developers might need to work offline as well. VC is designed |
1878 some features that allow you to keep network interactions to a | 1880 to reduce the amount of network interaction necessary. |
1879 minimum. | |
1880 | 1881 |
1881 @menu | 1882 @menu |
1882 * Version Backups:: Keeping local copies of repository versions. | 1883 * Version Backups:: Keeping local copies of repository versions. |
1883 * Local Version Control:: Using another version system for local editing. | 1884 * Local Version Control:: Using another version system for local editing. |
1884 @end menu | 1885 @end menu |
1885 | 1886 |
1886 @node Version Backups | 1887 @node Version Backups |
1887 @subsubsection Version Backups | 1888 @subsubsection Version Backups |
1888 @cindex version backups | 1889 @cindex version backups |
1889 | 1890 |
1890 When VC sees that the CVS repository for a file is on a remote machine, | |
1891 it automatically makes local backups of unmodified versions of the file. | |
1892 This means that you can compare the file to the repository version | |
1893 (@kbd{C-x v =}), or revert to that version (@kbd{C-x v u}), without any | |
1894 network interactions. | |
1895 | |
1896 The local copy of the unmodified file is called a @dfn{version backup}. | |
1897 This is to indicate that it corresponds exactly to a version that is | |
1898 stored in the repository. Note that version backups are related to, | |
1899 but distinct from the other kinds of backups that Emacs can make: | |
1900 single backups and numbered backups (@pxref{Backup}). | |
1901 | |
1902 @vindex vc-cvs-stay-local | |
1903 For a file that comes from a remote CVS repository, VC makes a version | |
1904 backup whenever you save the first changes to the file, and removes it | |
1905 after you have committed your modified version to the repository. (You | |
1906 can switch this off by setting the variable @code{vc-cvs-stay-local} to | |
1907 @code{nil}.) | |
1908 | |
1909 @cindex automatic version backups | 1891 @cindex automatic version backups |
1892 When VC sees that the CVS repository for a file is on a remote | |
1893 machine, it automatically makes local backups of unmodified versions | |
1894 of the file---@dfn{automatic version backups}. This means that you | |
1895 can compare the file to the repository version (@kbd{C-x v =}), or | |
1896 revert to that version (@kbd{C-x v u}), without any network | |
1897 interactions. | |
1898 | |
1899 The local copy of the unmodified file is called a @dfn{version | |
1900 backup} to indicate that it corresponds exactly to a version that is | |
1901 stored in the repository. Note that version backups are not the same | |
1902 as ordinary Emacs backup files (@pxref{Backup}). But they follow a | |
1903 similar naming convention. | |
1904 | |
1905 For a file that comes from a remote CVS repository, VC makes a | |
1906 version backup whenever you save the first changes to the file, and | |
1907 removes it after you have committed your modified version to the | |
1908 repository. You can disable the making of automatic version backups by | |
1909 setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | |
1910 | |
1910 @cindex manual version backups | 1911 @cindex manual version backups |
1911 The name of a version backup for a file named @var{file}, with version | 1912 The name of the automatic version backup for version @var{version} |
1912 @var{version}, is @code{@var{file}.~@var{version}.~}. Note that this | 1913 of file @var{file} is @code{@var{file}.~@var{version}.~}. This is |
1913 naming convention is almost the same as that used by @kbd{C-x v ~} | 1914 almost the same as the name used by @kbd{C-x v ~} (@pxref{Old |
1914 (@pxref{Old Versions}), the only difference being the additional dot | 1915 Versions}), the only difference being the additional dot (@samp{.}) |
1915 (@samp{.}) after the version number. This similarity is intentional, | 1916 after the version number. This similarity is intentional, because |
1916 because both kinds of files store the same kind of information. To | 1917 both kinds of files store the same kind of information. The file made |
1917 distinguish between them, we speak of @dfn{automatic version backups} | 1918 by @kbd{C-x v ~} acts as a @dfn{manual version backup}. |
1918 (those created by the mechanism described here) and @dfn{manual version | 1919 |
1919 backups} (created by @kbd{C-x v ~}). Their primary difference is that | 1920 All the VC commands that operate on old versions of a file can use |
1920 Emacs deletes automatic version backups when you commit to the | 1921 both kinds of version backups. For instance, @kbd{C-x v ~} uses |
1921 repository (this is why the trailing dot is needed to identify them), | 1922 either an automatic or a manual version backup, if possible, to get |
1922 while manual version backups are never deleted automatically. | 1923 the contents of the version you request. Likewise, @kbd{C-x v =} and |
1923 | 1924 @kbd{C-x v u} use either an automatic or a manual version backup, if |
1924 Each of the two mechanisms can use the files created by the other one. | 1925 one of them exists, to get the contents of a version to compare or |
1925 For example, if you changed a file outside of Emacs, so that no | 1926 revert to. If you changed a file outside of Emacs, so that no |
1926 automatic version backup was created, you can create a manual backup of | 1927 automatic version backup was created for the previous text, you can |
1927 that version using @kbd{C-x v ~}. Emacs will then use that file for | 1928 create a manual backup of that version using @kbd{C-x v ~}, and thus |
1928 local diff and revert operations. | 1929 obtain the benefit of the local copy for Emacs commands. |
1930 | |
1931 The only difference in Emacs's handling of manual and automatic | |
1932 version backups, once they exist, is that Emacs deletes automatic | |
1933 version backups when you commit to the repository. By contrast, | |
1934 manual version backups remain until you delete them. | |
1929 | 1935 |
1930 @node Local Version Control | 1936 @node Local Version Control |
1931 @subsubsection Local Version Control | 1937 @subsubsection Local Version Control |
1932 @cindex local version control | 1938 @cindex local version control |
1933 @cindex local back end (version control) | 1939 @cindex local back end (version control) |
1943 systems at the same time. For the description here, we will assume | 1949 systems at the same time. For the description here, we will assume |
1944 that the remote system is CVS, and you use RCS locally, although the | 1950 that the remote system is CVS, and you use RCS locally, although the |
1945 mechanism works with any combination of version control systems | 1951 mechanism works with any combination of version control systems |
1946 (@dfn{back ends}). | 1952 (@dfn{back ends}). |
1947 | 1953 |
1948 To make it work with other back ends, you must make sure that the "more | 1954 To make it work with other back ends, you must make sure that the |
1949 local" back end comes before the "more remote" back end in the setting | 1955 ``more local'' back end comes before the ``more remote'' back end in |
1950 of @var{vc-handled-backends} (@pxref{Customizing VC}). By default, this | 1956 the setting of @var{vc-handled-backends} (@pxref{Customizing VC}). By |
1951 variable is set up correctly so that you can use RCS and CVS as | 1957 default, this variable is set up so that you can use remote CVS and |
1952 described here. | 1958 local RCS as described here. |
1953 | 1959 |
1954 To start using local RCS for a file that comes from a remote CVS server, | 1960 To start using local RCS for a file that comes from a remote CVS |
1955 you must @dfn{commit the file to RCS}, by typing @kbd{C-u C-x v v rcs | 1961 server, you must @emph{register the file in RCS}, by typing @kbd{C-u |
1956 RET}. (In other words, @code{vc-next-action}, when called with a prefix | 1962 C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a |
1957 argument, accepts a back end name in place of the version to commit to.) | 1963 prefix argument, and specify RCS as the back end.) |
1958 VC then registers the file under RCS. | 1964 |
1959 | 1965 You can do this at any time; it does not matter whether you have |
1960 You can commit to RCS at any time; it does not matter whether you have | |
1961 already modified the file with respect to the version in the CVS | 1966 already modified the file with respect to the version in the CVS |
1962 repository. If possible, VC tries to make the RCS master start with | 1967 repository. If possible, VC tries to make the RCS master start with |
1963 the unmodified repository version, then checking in any local changes | 1968 the unmodified repository version, then checking in any local changes |
1964 as a new version. This works if you have not made any changes yet, | 1969 as a new version. This works if you have not made any changes yet, or |
1965 or if the unmodified repository version exists locally as a version | 1970 if the unmodified repository version exists locally as a version |
1966 backup (@pxref{Version Backups}). If the unmodified version is not | 1971 backup (@pxref{Version Backups}). If the unmodified version is not |
1967 available locally, the RCS master starts with the modified version; | 1972 available locally, the RCS master starts with the modified version; |
1968 the only problem with this is that you cannot compare your changes | 1973 the only drawback of this is that you cannot compare your changes |
1969 locally to what is stored in the repository. | 1974 locally to what is stored in the repository. |
1970 | 1975 |
1971 The version number of the RCS master is derived from the current CVS | 1976 The version number of the RCS master is derived from the current CVS |
1972 version, starting a branch from it. For example, if the current CVS | 1977 version, starting a branch from it. For example, if the current CVS |
1973 version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | 1978 version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in |
1974 the RCS master will be identical to version 1.23 under CVS; your first | 1979 the RCS master will be identical to version 1.23 under CVS; your first |
1975 changes are checked in as 1.23.1.1. (If the unmodified file is not | 1980 changes are checked in as 1.23.1.1. (If the unmodified file is not |
1976 available locally, VC will check-in the modified file twice, both as | 1981 available locally, VC will check in the modified file twice, both as |
1977 1.23 and 1.23.1.1, to make the revision numbers consistent.) | 1982 1.23 and 1.23.1.1, to make the revision numbers consistent.) |
1978 | 1983 |
1979 If you do not use locking under CVS (the default), locking is also | 1984 If you do not use locking under CVS (the default), locking is also |
1980 switched off under RCS, so that editing under RCS works exactly as | 1985 disabled for RCS, so that editing under RCS works exactly as under |
1981 under CVS. | 1986 CVS. |
1982 | 1987 |
1983 When you are done with your edits, you can commit the final version back | 1988 When you are done with your edits, you can commit the final version |
1984 to the CVS repository, typing @kbd{C-u C-x v v cvs RET}. Emacs will | 1989 back to the CVS repository, typing @kbd{C-u C-x v v cvs @key{RET}}. Emacs |
1985 initialize the log entry buffer (@pxref{Log Buffer}) to contain all the | 1990 will initialize the log entry buffer (@pxref{Log Buffer}) to contain |
1986 check-in comments you have made in the RCS master; you can make changes | 1991 all the log entries you have recorded in the RCS master; you can make |
1987 to these comments as needed and then commit to CVS by typing @kbd{C-c | 1992 changes to these comments as needed, and then commit in CVS by typing |
1988 C-c}. If the commit is successful, VC finally removes the RCS master, | 1993 @kbd{C-c C-c}. If the commit is successful, VC removes the RCS |
1989 so that the file becomes once again registered under CVS only. (The RCS | 1994 master, so that the file is once again registered under CVS only. |
1990 master is not actually deleted, but renamed by adding a @samp{~} to its | 1995 (The RCS master is not actually deleted, just renamed by appending |
1991 name, so that you can get back to it later if you want.) | 1996 @samp{~} to the name, so that you can refer to it later if you wish.) |
1992 | 1997 |
1993 While you are working with a local RCS master, you might still want to | 1998 While you are working with a local RCS master, you may still want to |
1994 pick up recent changes from the CVS repository into your local file, | 1999 pick up recent changes from the CVS repository into your local file, |
1995 or you might want to commit some of your changes back to CVS, without | 2000 or you might want to commit some of your changes back to CVS, without |
1996 actually switching back to CVS completely. VC lets you do this by | 2001 actually switching back to CVS completely. You can do this by |
1997 switching to another backend temporarily. | 2002 switching to another backend temporarily. |
1998 | 2003 |
1999 @table @kbd | 2004 @table @kbd |
2000 @item C-x v b | 2005 @item C-x v b |
2001 Switch to any other back end that the current file is registered | 2006 Switch to another back end that the current file is registered |
2002 under (@code{vc-switch-backend}). | 2007 under (@code{vc-switch-backend}). |
2008 | |
2009 @item C-u C-x v b @var{backend} @key{RET} | |
2010 Switch to @var{backend} for the current file. | |
2003 @end table | 2011 @end table |
2004 | 2012 |
2005 @kindex C-x v b | 2013 @kindex C-x v b |
2006 @findex vc-switch-backend | 2014 @findex vc-switch-backend |
2015 @kbd{C-x v b} does not change the buffer contents, or any files; it | |
2016 only changes VC's perspective on how to handle the file. Any | |
2017 subsequent VC commands for that file will operate on the back end that | |
2018 is currently selected. | |
2019 | |
2007 If the current file is registered in more than one back end, typing | 2020 If the current file is registered in more than one back end, typing |
2008 @kbd{C-x v b} lets you ``cycle'' through these back ends. (With a prefix | 2021 @kbd{C-x v b} ``cycles'' through all of these back ends. With a |
2009 argument, it asks for the back end to use in the minibuffer.) This | 2022 prefix argument, it asks for the back end to use in the minibuffer. |
2010 command does not change any files, it only changes VC's perspective of | |
2011 the file. Any other VC commands that you use on a file will operate on | |
2012 the back end that is currently selected. | |
2013 | 2023 |
2014 Thus, if you have a file under local RCS, and you want to pick up some | 2024 Thus, if you have a file under local RCS, and you want to pick up some |
2015 recent changes from CVS, type @kbd{C-x v b} to switch to CVS, and then | 2025 recent changes from CVS, type @kbd{C-x v b} to switch to CVS, and then |
2016 @kbd{C-x v m RET} to merge the news (@pxref{Merging}). You can then switch | 2026 @kbd{C-x v m @key{RET}} to merge the news (@pxref{Merging}). You can |
2017 back to RCS by typing @kbd{C-x v b} again, and continue to edit locally. | 2027 then switch back to RCS by typing @kbd{C-x v b} again, and continue to |
2028 edit locally. | |
2018 | 2029 |
2019 Note though, that if you do this, the revision numbers in the RCS | 2030 Note though, that if you do this, the revision numbers in the RCS |
2020 master no longer correspond to those of CVS in a meaningful way. | 2031 master no longer correspond to those of CVS in a meaningful way. |
2021 Technically, this is not a problem, but it might be more difficult for | 2032 Technically, this is not a problem, but it might be more difficult for |
2022 you to keep track of what is in the repository and what is not. So we | 2033 you to keep track of what is in the repository and what is not. So we |
2023 suggest that, frequently, you commit your changes back to CVS | 2034 suggest that, frequently, you commit your changes back to CVS |
2024 completely using @kbd{C-u C-x v v cvs RET}. | 2035 completely using @kbd{C-u C-x v v cvs @key{RET}}. |
2025 | 2036 |
2026 @node Snapshots | 2037 @node Snapshots |
2027 @subsection Snapshots | 2038 @subsection Snapshots |
2028 @cindex snapshots and version control | 2039 @cindex snapshots and version control |
2029 | 2040 |
2170 @end iftex | 2181 @end iftex |
2171 | 2182 |
2172 @noindent | 2183 @noindent |
2173 You can then edit the new change log entry further as you wish. | 2184 You can then edit the new change log entry further as you wish. |
2174 | 2185 |
2175 Unfortunately, timestamps in ChangeLog files are only dates, so some | 2186 Some of the new change log entry may duplicate what's already in |
2176 of the new change log entry may duplicate what's already in ChangeLog. | 2187 ChangeLog. You will have to remove these duplicates by hand. |
2177 You will have to remove these duplicates by hand. | |
2178 | 2188 |
2179 Normally, the log entry for file @file{foo} is displayed as @samp{* | 2189 Normally, the log entry for file @file{foo} is displayed as @samp{* |
2180 foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | 2190 foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted |
2181 if the text of the log entry starts with @w{@samp{(@var{functionname}): | 2191 if the text of the log entry starts with @w{@samp{(@var{functionname}): |
2182 }}. For example, if the log entry for @file{vc.el} is | 2192 }}. For example, if the log entry for @file{vc.el} is |
2389 VC uses the system that comes first in @var{vc-handled-backends} by | 2399 VC uses the system that comes first in @var{vc-handled-backends} by |
2390 default. The order is also significant when you register a file for | 2400 default. The order is also significant when you register a file for |
2391 the first time, @pxref{Registering} for details. | 2401 the first time, @pxref{Registering} for details. |
2392 | 2402 |
2393 @menu | 2403 @menu |
2394 * General VC Options:: Options not specific for any back end system. | 2404 * General VC Options:: Options that apply to multiple back ends. |
2395 * RCS Options:: Options for RCS. | 2405 * RCS and SCCS:: Options for RCS and SCCS. |
2396 * CVS Options:: Options for CVS. | 2406 * CVS Options:: Options for CVS. |
2397 * SCCS Options:: Options for SCCS. | |
2398 @end menu | 2407 @end menu |
2399 | 2408 |
2400 @node General VC Options | 2409 @node General VC Options |
2401 @subsubsection General Options | 2410 @subsubsection General Options |
2402 | 2411 |
2441 displays messages to indicate which shell commands it runs, and | 2450 displays messages to indicate which shell commands it runs, and |
2442 additional messages when the commands finish. | 2451 additional messages when the commands finish. |
2443 | 2452 |
2444 @vindex vc-path | 2453 @vindex vc-path |
2445 You can specify additional directories to search for version control | 2454 You can specify additional directories to search for version control |
2446 programs by setting the variable @code{vc-path}. These directories are | 2455 programs by setting the variable @code{vc-path}. These directories |
2447 searched before the usual search path. But the proper files are usually | 2456 are searched before the usual search path. It is rarely necessary to |
2448 found automatically. | 2457 set this variable, because VC normally finds the proper files |
2449 | 2458 automatically. |
2450 @node RCS Options | 2459 |
2451 @subsubsection Options specific for RCS | 2460 @node RCS and SCCS |
2461 @subsubsection Options for RCS and SCCS | |
2452 | 2462 |
2453 @cindex non-strict locking (RCS) | 2463 @cindex non-strict locking (RCS) |
2454 @cindex locking, non-strict (RCS) | 2464 @cindex locking, non-strict (RCS) |
2455 By default, RCS uses locking to coordinate the activities of several | 2465 By default, RCS uses locking to coordinate the activities of several |
2456 users, but there is a mode called @dfn{non-strict locking} in which | 2466 users, but there is a mode called @dfn{non-strict locking} in which |
2457 you can check-in changes without locking the file first. Use | 2467 you can check-in changes without locking the file first. Use |
2458 @samp{rcs -U} to switch to non-strict locking for a particular file, | 2468 @samp{rcs -U} to switch to non-strict locking for a particular file, |
2459 see the @samp{rcs(1)} manpage for details. | 2469 see the @code{rcs} manpage for details. |
2460 | 2470 |
2461 When deducing the version control state of a file, VC first looks | 2471 When deducing the version control state of an RCS file, VC first |
2462 for an RCS version header string in the file (@pxref{Version | 2472 looks for an RCS version header string in the file (@pxref{Version |
2463 Headers}). If there is no header string, VC normally looks at the | 2473 Headers}). If there is no header string, VC normally looks at the |
2464 file permissions of the work file; this is fast. But there might be | 2474 file permissions of the work file; this is fast. But there might be |
2465 situations when the file permissions cannot be trusted. In this case | 2475 situations when the file permissions cannot be trusted. In this case |
2466 the master file has to be consulted, which is rather expensive. Also | 2476 the master file has to be consulted, which is rather expensive. Also |
2467 the master file can only tell you @emph{if} there's any lock on the | 2477 the master file can only tell you @emph{if} there's any lock on the |
2469 version. | 2479 version. |
2470 | 2480 |
2471 @vindex vc-consult-headers | 2481 @vindex vc-consult-headers |
2472 You can tell VC not to use version headers to determine the file | 2482 You can tell VC not to use version headers to determine the file |
2473 status by setting @code{vc-consult-headers} to @code{nil}. VC then | 2483 status by setting @code{vc-consult-headers} to @code{nil}. VC then |
2474 always uses the file permissions (if it can trust them), or else | 2484 always uses the file permissions (if it is supposed to trust them), or |
2475 checks the master file. | 2485 else checks the master file. |
2476 | 2486 |
2477 @vindex vc-mistrust-permissions | 2487 @vindex vc-mistrust-permissions |
2478 You can specify the criterion for whether to trust the file | 2488 You can specify the criterion for whether to trust the file |
2479 permissions by setting the variable @code{vc-mistrust-permissions}. | 2489 permissions by setting the variable @code{vc-mistrust-permissions}. |
2480 Its value can be @code{t} (always mistrust the file permissions and | 2490 Its value can be @code{t} (always mistrust the file permissions and |
2484 non-@code{nil} value from the function says to mistrust the file | 2494 non-@code{nil} value from the function says to mistrust the file |
2485 permissions. If you find that the file permissions of work files are | 2495 permissions. If you find that the file permissions of work files are |
2486 changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. | 2496 changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. |
2487 Then VC always checks the master file to determine the file's status. | 2497 Then VC always checks the master file to determine the file's status. |
2488 | 2498 |
2499 VC determines the version control state of files under SCCS much as | |
2500 with RCS. It does not consider SCCS version headers, though. Thus, | |
2501 the variable @var{vc-mistrust-permissions} affects SCCS use, but | |
2502 @var{vc-consult-headers} does not. | |
2503 | |
2489 @node CVS Options | 2504 @node CVS Options |
2490 @subsubsection Options specific for CVS | 2505 @subsubsection Options specific for CVS |
2491 | 2506 |
2492 @cindex locking (CVS) | 2507 @cindex locking (CVS) |
2493 By default, CVS does not use locking to coordinate the activities of | 2508 By default, CVS does not use locking to coordinate the activities of |
2494 several users; anyone can change a work file at any time. However, | 2509 several users; anyone can change a work file at any time. However, |
2495 there are ways to restrict this, resulting in behavior that resembles | 2510 there are ways to restrict this, resulting in behavior that resembles |
2496 locking. | 2511 locking. |
2497 | 2512 |
2498 @cindex CVSREAD environment variable (CVS) | 2513 @cindex CVSREAD environment variable (CVS) |
2499 For one thing, you can set the @env{CVSREAD} environment variable to | 2514 For one thing, you can set the @env{CVSREAD} environment variable |
2500 an arbitrary value. If this variable is defined, CVS makes your work | 2515 (the value you use makes no difference). If this variable is defined, |
2501 files read-only by default. In Emacs, you must type @kbd{C-x C-q} to | 2516 CVS makes your work files read-only by default. In Emacs, you must |
2502 make the file writeable, so that editing works in fact similar as if | 2517 type @kbd{C-x C-q} to make the file writeable, so that editing works |
2503 locking was used. Note however, that no actual locking is performed, so | 2518 in fact similar as if locking was used. Note however, that no actual |
2504 several users can make their files writeable at the same time. When | 2519 locking is performed, so several users can make their files writeable |
2505 setting @env{CVSREAD} for the first time, make sure to check out all | 2520 at the same time. When setting @env{CVSREAD} for the first time, make |
2506 your modules anew, so that the file protections are set correctly. | 2521 sure to check out all your modules anew, so that the file protections |
2522 are set correctly. | |
2507 | 2523 |
2508 @cindex cvs watch feature | 2524 @cindex cvs watch feature |
2509 @cindex watching files (CVS) | 2525 @cindex watching files (CVS) |
2510 Another way to achieve something similar to locking is to use the | 2526 Another way to achieve something similar to locking is to use the |
2511 @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | 2527 @dfn{watch} feature of CVS. If a file is being watched, CVS makes it |
2524 state (and possibly information returned by previous CVS commands). One | 2540 state (and possibly information returned by previous CVS commands). One |
2525 consequence of this is that when you have modified a file, and somebody | 2541 consequence of this is that when you have modified a file, and somebody |
2526 else has already checked in other changes to the file, you are not | 2542 else has already checked in other changes to the file, you are not |
2527 notified of it until you actually try to commit. (But you can try to | 2543 notified of it until you actually try to commit. (But you can try to |
2528 pick up any recent changes from the repository first, using @kbd{C-x v m | 2544 pick up any recent changes from the repository first, using @kbd{C-x v m |
2529 RET}, @pxref{Merging}). | 2545 @key{RET}}, @pxref{Merging}). |
2530 | 2546 |
2531 When @var{vc-cvs-stay-local} is @code{t}, VC also makes local | 2547 When @var{vc-cvs-stay-local} is @code{t}, VC also makes local |
2532 version backups, so that simple diff and revert operations are | 2548 version backups, so that simple diff and revert operations are |
2533 completely local (@pxref{Version Backups}). | 2549 completely local (@pxref{Version Backups}). |
2534 | 2550 |
2535 On the other hand, if you set @var{vc-cvs-stay-local} to @code{nil}, | 2551 On the other hand, if you set @var{vc-cvs-stay-local} to @code{nil}, |
2536 then VC queries the remote repository @emph{before} it decides what to | 2552 then VC queries the remote repository @emph{before} it decides what to |
2537 do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | 2553 do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local |
2538 repositories. It also does not make any version backups. | 2554 repositories. It also does not make any version backups. |
2539 | 2555 |
2540 You can also set @var{vc-cvs-stay-local} to a regexp that is matched | 2556 You can also set @var{vc-cvs-stay-local} to a regular expression |
2541 against the repository hostname; VC then stays local only for | 2557 that is matched against the repository hostname; VC then stays local |
2542 repositories from hosts that match the pattern. | 2558 only for repositories from hosts that match the pattern. |
2543 | |
2544 @node SCCS Options | |
2545 @subsubsection Options specific for SCCS | |
2546 | |
2547 VC determines the version control state of files under SCCS similar as | |
2548 under RCS. It does not consider SCCS version headers, though. Thus, | |
2549 the variable @var{vc-mistrust-permissions} is used in the same way as | |
2550 under RCS, @pxref{RCS Options} for details. | |
2551 | |
2552 | 2559 |
2553 @node Directories | 2560 @node Directories |
2554 @section File Directories | 2561 @section File Directories |
2555 | 2562 |
2556 @cindex file directory | 2563 @cindex file directory |
2787 | 2794 |
2788 If you enable Auto Compression mode (@pxref{Compressed Files}), then | 2795 If you enable Auto Compression mode (@pxref{Compressed Files}), then |
2789 Tar mode is used also for compressed archives---files with extensions | 2796 Tar mode is used also for compressed archives---files with extensions |
2790 @samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}. | 2797 @samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}. |
2791 | 2798 |
2792 The keys @kbd{e}, @kbd{f} and @kbd{RET} all extract a component file | 2799 The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file |
2793 into its own buffer. You can edit it there and when you save the buffer | 2800 into its own buffer. You can edit it there and when you save the buffer |
2794 the edited version will replace the version in the Tar buffer. @kbd{v} | 2801 the edited version will replace the version in the Tar buffer. @kbd{v} |
2795 extracts a file into a buffer in View mode. @kbd{o} extracts the file | 2802 extracts a file into a buffer in View mode. @kbd{o} extracts the file |
2796 and displays it in another window, so you could edit the file and | 2803 and displays it in another window, so you could edit the file and |
2797 operate on the archive simultaneously. @kbd{d} marks a file for | 2804 operate on the archive simultaneously. @kbd{d} marks a file for |