Section 10.2. CVS Commands


10.2. CVS Commands

Most of your interaction with CVS is through the various CVS commands. Even if you use a graphical client, most of the functions the client uses call the CVS commands.

Most commands have a shortened nickname that you can type instead of the longer command name. These are called command synonyms in CVS jargon.

10.2.1. add

Synonyms: ad, new

cvs [cvs-options] add [-k mode] [-m message] files

Adds a file or directory to the repository. This command can also be used to undo an uncommitted file deletion or to restore a deleted file. A file that is added with this command is not uploaded to the repository until the next cvs commit. A directory is added immediately (unless you are using a client with an "offline" mode, and are offline).

10.2.1.1. Command options

-k mode

Add a file or files with the designated keyword-expansion mode. This option also sets the default keyword mode for the file. If you forget to set the default keyword mode when you cvs add a file, you can do so later with cvs admin, unless the repository administrator has limited the users of cvs admin.

The keyword-expansion modes are listed in "Keywords and Keyword Modes" of Chapter 11 and are explained in "Keywords" in Chapter 3.


-m message

Use the specified message as the description of the newly added file. The description is shown in cvs log output.

10.2.1.2. Description

Files and directories added with this command must already exist, and must be within a sandbox. They are added to the directory in the repository that corresponds to the one in the sandbox.

If you are using branches, be aware that the file or directory is added only to the branch or trunk that the sandbox directory is part of. To add it to other branches as well, you will need to merge it; see Chapter 4 for more information.

Note that you must explicitly state which files are added, though you can use wildcards like * to specify a group of files.

In Example 1, I add a single file. Example 2 shows the use of wildcards. Example 3 shows a correction of an unwanted file removal.

10.2.1.3. Example 1
 jenn@soldier:~/wizzard/doc/design$ cvs add Design.rtf cvs server: scheduling file 'Design.rtf' for addition cvs server: use 'cvs commit' to add this file permanently 

10.2.1.4. Example 2
 jenn@soldier:~/wizzard/lib$ cvs add *.h cvs add: scheduling file 'acconfig.h' for addition cvs add: scheduling file 'getdate.h' for addition cvs add: scheduling file 'gettext.h' for addition cvs add: scheduling file 'utils.h' for addition cvs add: use 'cvs commit' to add these files permanently 

10.2.1.5. Example 3
 jenn@soldier:~/wizzard/src$ cvs add handheld.c cvs add: 'handheld.c', version 1.3, resurrected U handheld.c 

10.2.2. admin

Synonyms: adm, rcs

cvs [cvs-options] admin [-iILqU] [-ausernames] [-Afilename] [-b[revision]] [-cstring] [-e[usernames]] [-kmode] [-l[revision]] [-mrevision:message] [-ntagname[:[revision]]] [-Ntagname[:[revision]]] [-orange] [-sstate[:revision]] [-t[filename]] [-t-string] [-u [revision]] [-VN] [-xsuffix] [files...]

Use a variety of special administrative commands (RCS commands) on the repository copy of project files. Many of these commands have no effect on CVS, and exist mostly as historic artifactsthough the more guru-like of the repository administrators may find uses for them.

10.2.2.1. Command options

-ausernames

(No effect in CVS.) Append the comma-separated list of usernames to the RCS access list in the repository (RCS-format) copy of a file.

See also -A and -e.


-Afilename

(No effect in CVS.) Append the RCS access list in filename to the access list of the files being operated on.

See also -a and -e.


-b[revision]

(Use with great caution!) Set the default branch of a file to the named branch revision; or, if no revision is named, set the default branch to the highest branch revision on the trunk. This option should be used very rarely in CVS; it is better to check out a sandbox as a branch sandbox with the -r option to checkout or update.

You can use this option to revert a file or project to the vendor's version, if you are using vendor branches, which are explained in Chapter 7.


-cstring

Set the RCS comment leader of a file to the specified string. This option is significant if the configuration option UseArchiveCommentLeader is set to true.


-e[usernames]

(No effect in CVS.) Remove the comma-separated list of usernames from the RCS access list in the repository (RCS-format) copy of a file. If no list of usernames is provided, remove all names.

See also -a and -A.


-i

(Not used in CVS.) Create and initialize an RCS file. This option is not used in CVS (use cvs add instead), and it is not available in CVS 1.9.14 and later.


-I

Run interactively. This option does not work in client/server-mode CVS and may be removed from later versions of CVS.


-kmode

Set the default keyword-expansion mode for a file.

The keyword-expansion modes are listed in the "Keywords and Keyword Modes" section of Chapter 11 and explained in "Keywords" in Chapter 3.


-l[revision]

Lock the specified revision of a file so that another user cannot commit to it. If revision is omitted, CVS locks the latest revision on the current sandbox's branch or the trunk. To work with CVS, the lock requires a script such as the rcslock script in the contrib directory of the source. Chapter 5 explains how to use this option.

See also -u.


-L

Set RCS locking for a file to strict, which means that the owner of the file must lock the file before committing. (This locking is done by the CVS code and need not be done manually.)

File locking must be set to strict for CVS to work properly.

See also -U.


-mrevision:message

Replace the log message of the designated revision of a file with the specified message.


-ntagname[:[revision]]

(Use with caution!) Tag the designated revision or branch of a file with the tagname. If there is no revision and no colon, delete the tag; if there is a colon but no revision, tag the latest revision on the default branch, usually the trunk. If the tagname is already present in the file (and the operation isn't delete), this option prints an error and exits.

Generally, it is better to use cvs tag and cvs rtag to manipulate tags.

See also -N.


-Ntagname[:[revision]]

(Use with caution!) Tag the designated revision or branch of a file with the tagname. If there is no revision and no colon, delete the tag; if there is a colon but no revision, tag the latest revision on the default branchusually the trunk. If the tagname is already present in the file (and the operation isn't delete), this option moves the tag to the new revision.

Generally, it is better to use cvs tag and cvs rtag to manipulate tags.

See also -n.


-orange

(Use with extreme caution!) Delete the revisions specified in the range. The revisions given in the range can be revision numbers or tags, but be wary of using tags if multiple tags in a file denote the same revision.

There is no way to undo a cvs admin -orange command.


If using tags rather than revision numbers, be very careful with thisyou could delete a file revision you had not intended to. (If the tags alpha, beta, and gamma refer to the same revision number in a file, and you delete alpha:beta, you have also lost gamma.) You cannot use tags with the :: versions of this command.

CVS does not cope well if you delete a revision and someone then tries to commit changes made against that revision. If this happens, you will almost certainly need to restore from backup.

The range can be any of the following:


revision1:revision2

Delete revisions between revision1 and revision2, including revision1 and revision2.


revision1::revision2

Delete revisions between revision1 and revision2, excluding revision1 and revision2.


revision:

Delete revision and all newer revisions on the same branch (or the trunk).


revision::

Delete all revisions newer than revision on the same branch (or the trunk).


:revision

Delete revision and all older revisions on the same branch (or the trunk). This range does not delete the base revision of the branch or revision 1.1.


::revision

Delete all revisions older then revision on the same branch (or the trunk). This range does not delete the base revision of the branch or revision 1.1.


revision

Delete revision.


-q

Run quietly, without printing diagnostics (redundant with cvs -q admin).


-sstate[:revision]

Set the state of the designated revision of a file, or set the last revision on the trunk or the current branch if no revision is listed. The state should be a string and is shown in the output of cvs log and by the Log and State keywords. The dead state is reserved for CVS internal use.


-t[filename]

Write the contents of the file specified by filename to the description of each file listed in the command. The description is shown in cvs log output. This option deletes any existing description. If the filename is omitted, CVS seeks input from standard input (stdin), ending with a period (.) on a line by itself.

See also -t-string.


-t-string

Write the contents of the string to the description of each file listed in the command. The description is an RCS field, shown in cvs log output. This option deletes any existing description.

See also -t[filename].


-u[revision]

Unlock the specified revision of a file so that another user can commit from that revision. If the revision is omitted, this option unlocks the latest revision on the current sandbox's branch or the trunk. This option requires a script such as the rcslock script in the contrib directory of the source. Chapter 5 explains how to use this option.

See also -l.


-U

(Can prevent CVS from working!) Set RCS locking for a file to nonstrict, which means that the owner of the file does not need to lock the file before committing. (This locking is done by the CVS code and need not be done manually.)

File locking must be set to strict for CVS to work properly. This option should never be used on CVS-stored files.

See also -L.


-VN

(Not used in CVS.) Write an RCS file compatible with RCS version N. This option is not used in CVS anymore, and it is not available in CVS 1.9.20 and later.


-xsuffix

(Not used in CVS.) Specify the suffix for the RCS file. All CVS files use ,v, so this is an unused command.

10.2.2.2. Description

The cvs admin command is a frontend for a range of useful (though sometimes useless to CVS) RCS-based commands. Project files are stored in the repository in RCS format, so it is useful to have a way to use some of the RCS commands on the files directly. This command and the useful options are explained in Chapter 7.

Note that if the cvsadmin group exists on the server, only members of that group can use cvs admin. A limited set of commands can be made available to general users with the UserAdminOptions setting in the config file in CVSROOT.

The -c, -k, -s, and -t options are useful to general users, as are -l and -u if you're using rcslock (see Chapter 5). I would recommend setting an empty cvsadmin group (to prevent anyone using most of these commands), and setting UserAdminOptions to permit the three (or five) useful options.

The -m option permits users to modify old log messages, and is either useful or dangerous depending on how strictly you want to maintain the history of project changes. (I can envision potential mischief with it.) Think carefully about whether or not you want to add it to UserAdminOptions.

In Example 1, I tell CVS to treat a Word document as binary. In Example 2, I am setting the RCS comment leader of all the .h files in the current directory.

10.2.2.3. Example 1
 jenn@soldier/wizzard/doc/design$ cvs admin -kb AcceptanceTest.doc RCS file: /var/lib/cvs/wizzard/doc/design/AcceptanceTest.doc,v done 

10.2.2.4. Example 2
 jenn@soldier:~/wizzard/lib$ cvs admin -c"Log: " *.h RCS file: /var/lib/cvs/wizzard/lib/acconfig.h,v done RCS file: /var/lib/cvs/wizzard/lib/getdate.h,v done RCS file: /var/lib/cvs/wizzard/lib/gettext.h,v done RCS file: /var/lib/cvs/wizzard/lib/utils.h,v done 

10.2.3. annotate

Synonym: ann

cvs [cvs-options] annotate [-fFlR] [-D date] [-r revision] [files...]

Displays a file or files with annotations about the last change of each line. The annotations give the editor, and the revision number of the latest revision. If no files are used in the argument, the files in the current sandbox are shown.

See also rannotate.

10.2.3.1. Command options

-D date

Run annotate on the latest revision of a file that is as old as or older than the date or time specified by date.


-f

Use the latest (HEAD) revision of a file that is on the current branch or trunk if no revision matches a specified date or revision number. This option applies only if -r or -D is used.


-F

Show annotations for binary files. (Note that binary files may have extremely long lines.)


-l

Run annotate on the files in the local directory only. (Do not recurse into subdirectories.)


-r revision[:date]

Run annotate on the specified revision or tag of a file. If this option refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run annotate on the files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

10.2.3.2. Example 1
 jenn@soldier:~/wizzard$$ cvs annotate Makefile Annotations for Makefile *************** 1.2  (jenn     01-Sep-06): # 1.2  (jenn     01-Sep-06): # Makefile for the Wizzard project (jenn     01-Sep-06): # Created by J Vesperman, 1 September 2002 

10.2.3.3. Example 2
 jenn@soldier:~/zebedee/src$ cvs annotate utils.cc Annotations for utils.cc *************** 1.4          (dancer   14-Apr-06): #ifdef HAVE_CONFIG_H 1.4          (dancer   14-Apr-06): #include <config.h> 1.4          (dancer   14-Apr-06): #endif 1.1          (jenn   13-Apr-06): #include "utils.h" 1.1          (jenn   13-Apr-06): 1.9          (dancer   19-Apr-06): #include <string> 1.10         (jenn   17-Oct-06): extern std::string config_prefix; 1.10         (jenn   17-Oct-06): const std::string fixpath(const std::string & oldpath) 

10.2.4. checkout

Synonyms: co, get

cvs [cvs-options] checkout [-AcflnNpPrs] [-d directory-name] [-D date] [-j revision[:date]] [-j revision2[:date2]] [-k mode] [-r revision] projects...

Creates a new sandbox in the current working directory, or updates an existing sandbox. (The update command is preferred for updating a sandbox, because it doesn't have the additional code for creating a new sandbox.)

See also export and update.

10.2.4.1. Command options

-A

Clear sticky tags, dates, and keyword-expansion modes from a project and replace the current files with the head of the trunk. See "Stickiness" in Chapter 4.


-c

Display the contents of the modules file in the repository's CVSROOT directory. This option lists the modules in the current repository and the options applicable to those modules.

See also -s.

checkout -c lists only those projects that have entries in the modules file.



-d directory-name

Check a sandbox out into a directory called directory-name instead of using the repository directory name or the name designated in the modules file in the repository's CVSROOT directory. This is particularly useful when creating a second sandbox for a project.

CVS usually creates the same directory structure that the repository uses. However, if the checkout parameter contains only one file or directory and the -d option is used, CVS does not create any intervening directories, thus shortening the directory path to the single file or directory. Use -N to prevent CVS from shortening the path.

For example, if the repository contains a project my, with a file at my/very/long/path/to/beachfront.txt, and you use checkout -d beach my/very/long/path/to/beachfront.txt, CVS will produce a sandbox beach containing only beachfront.txt.

If you use checkout -N -d beach my/very/long/path/to/beachfront.txt, CVS will produce a sandbox beach containing the entire directory chain very/long/path/to, with beachfront.txt in the directory to.


-D date

Check out the latest revision of each file in a project that is as old as or older than the date or time specified by date. This option implies the -P option and produces a sticky date on the new sandbox.


-f

Use the latest (HEAD) revision on the current branch or trunk if no revision matches the date or revision number. This applies only if -r or -D is used.


-j revision[:date]

Determine the common ancestor of the revision the files in the sandbox are based on and the specified revision, then determine the changes between that common ancestor and the revision specified, and merge those changes to the sandbox.

If two -j options are used, determine the changes between the first -j revision and the second -j revision and merge those changes to the sandbox.

The date can be used only if the revision designates a branch. date specifies the latest revision on that date.


-k mode

Check out a sandbox with the designated keyword-expansion mode. This option also sets a sticky keyword mode for the sandbox, so that later commands operate with the same keyword-expansion mode unless a -k option overrides that mode. Prior to CVS 1.12.2, the -k option overrides the default mode for each file. After that version of CVS, -kb will not be overridden.

The keyword-expansion modes are listed in "Keywords and Keyword Modes" of Chapter 11 and are explained in "Keywords" in Chapter 3.


-l

Run checkout on the local directory only. (Do not check out subdirectories.)

See also -R.


-n

Do not run any program listed in the modules file for this directory.


-N

Do not shorten the path. CVS usually creates the same directory structure that the repository uses. However, if the checkout contains only one file and the -d option is used, CVS does not create any intervening directories unless -N is also specified.


-p

Check out the listed files to the standard output (usually the screen), rather than to a sandbox.


-P

Do not include empty directories in the sandbox.


-r revision[:date]

Run checkout on the specified revision or tag. If this option refers to a branch, run the command on the latest (HEAD) revision of the branch. This option implies the -P option and produces a sticky tag on the new sandbox.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run checkout on the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.


-s

Display the contents of the modules file in the repository's CVSROOT directory. This option lists the modules in the current repository and their status.

See also -c.

10.2.4.2. Description

The projects argument to checkout may be one or more paths to directories within the repository, paths to files within the repository, or module names as specified in the modules file in the repository's CVSROOT directory. These paths must be separated by spaces, and are relative to the repository's root directory.

When creating a new sandbox, the repository path must be specified by using the -d repository_path CVS option or the CVSROOT environment variable. Repository paths are explained in more detail in Chapter 8.

If you are creating a new sandbox inside an existing sandbox, the CVS/Root file of the current directory in the existing sandbox can provide a repository path. In most cases, having a sandbox inside a sandbox is needlessly confusing.

Example 1 is a simple checkout of the wizzard project from the repository on blackrock. Example 2 is a checkout of the beta_0-1-branch of the wizzard project, into a sandbox named for the branch.

10.2.4.3. Example 1
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs checkout wizzard cvs checkout: Updating wizzard U wizzard/Changelog U wizzard/INSTALL U wizzard/Makefile U wizzard/README U wizzard/TODO cvs checkout: Updating wizzard/doc cvs checkout: Updating wizzard/doc/design U wizzard/doc/design/AcceptanceTest.doc U wizzard/doc/design/Analysis.rtf U wizzard/doc/design/Design.rtf U wizzard/doc/design/Requirements.doc U wizzard/doc/design/Specification.rtf cvs checkout: Updating wizzard/doc/plan U wizzard/doc/plan/Schedule.rtf 

10.2.4.4. Example 2
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs checkout \ > -rbeta_0-1_branch -dbeta_0-1_branch wizzard cvs checkout: Updating beta_0-1_branch U beta_0-1_branch/Changelog U beta_0-1_branch/INSTALL U beta_0-1_branch/Makefile U beta_0-1_branch/README U beta_0-1_branch/TODO cvs checkout: Updating beta_0-1_branch/doc cvs checkout: Updating beta_0-1_branch/doc/design U beta_0-1_branch/doc/design/AcceptanceTest.doc U beta_0-1_branch/doc/design/Analysis.rtf U beta_0-1_branch/doc/design/Requirements.doc U beta_0-1_branch/doc/design/Specification.rtf cvs checkout: Updating beta_0-1_branch/doc/plan U beta_0-1_branch/doc/plan/Schedule.rtf 

10.2.5. commit

Synonyms: ci, com

cvs [cvs-options] commit [-flnR] [-m message | -F logfile] [-r revision] [files...]

Commits changes in a sandbox to the repository.

10.2.5.1. Command options

-c

This option is useful to encourage file watching (see Chapter 5). It blocks commit from working unless the files being committed have been properly flagged with cvs edit. If you are using file watching, have all your developers put the -c flag for commit and edit in their .cvsrc.

(Requires both client and server to be CVS 1.12.10 or later.)


-f

Force CVS to commit a file even if there have been no changes to the file. This option implies the -l option, but you can use both -f and -R to do a forced recursive commit.

From CVS 1.12.10, -f causes -c to be ignored.


-F logfile

Read a log message from the specified logfile rather than calling an editor.


-l

Run commit on the files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-m message

Use the message when committing a file, rather than calling an editor.


-n

Do not run any program listed in the modules file (in the repository's CVSROOT directory) for this directory.


-r revision

Commit any changes to the specified revision number. The revision number must be higher than any current revision number for the file or files.

If revision is a branch tag or a revision number on a branch, commit to the head of the branch.


-R

Run commit on the files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.5.2. Description

The cvs commit command uploads changes in a sandbox to the repository. Until a commit is run, changes such as modified, new, or removed files are not reflected in the repository. If no files are listed as arguments, CVS uploads all changes in the current sandbox.

Unless you use either the -m or -F options, commit calls an editor to request a log message.

If there have been changes in the repository version of a file since it was last synchronized with the repository and the local version has also changed, you have a conflict and the file cannot be committed. You can try to commit the file again once you have updated it using cvs update or cvs checkout. The update will include an attempt to merge the file. See Chapter 3 for an explanation of file conflicts and how to resolve them.

Since CVS 1.12.12, a commit id is added to the file. This ID is unique for each commit, and is the same for all files committed at once.

Example 1 is a simple commit. In Example 2, I force CVS to commit the unchanged file README and to give it the revision number 1.6.

10.2.5.3. Example 1
 jenn@soldier:~/wizzard$$ cvs commit cvs commit: Examining . cvs commit: Examining doc cvs commit: Examining lib . . . RCS file: /var/lib/cvs/wizzard/doc/design/Design.rtf,v done Checking in doc/design/Design.rtf; /var/lib/cvs/wizzard/doc/design/Design.rtf,v  <--  Design.rtf initial revision: 1.1 done 

10.2.5.4. Example 2
 jenn@soldier:~/wizzard$ cvs commit -f -r 1.6 README /var/lib/cvs/wizzard/README,v  <--  README new revision: 1.6; previous revision: 1.2 

10.2.6. diff

Synonyms: di, dif

cvs [cvs-options] diff [format-options] [-lR] [-D date] [-D date2] [-f file] [-k mode] [-r revision] [-r revision2] [files...]

Displays the differences between two revisions of a file or files. By default, diff checks the sandbox copy against the revision in the repository that the sandbox copy was last synchronized with. If the files argument is a directory, all files under that directory are compared and files in subdirectories are also compared recursively.

See also rdiff.

10.2.6.1. Standard options

Options described in this section determine which files and revisions are compared by cvs diff. These options are the same as the standard options for most CVS commands. The -k option may be used to slightly modify the data sent to diff.


-D date

Display the differences between the current sandbox copy of a file and the latest revision on or before the date or time specified by date.

If two -D options are used, display the differences between the latest revision before the first date and the latest revision before the second date. One or both -D options can be replaced with -r.


-k mode

Run diff with the designated keyword-expansion mode. This option overrides the default mode and any sticky modes for each file. It's useful to use -kk with diff to avoid spurious differences being reported (such as expansion of the $Revision$ keyword).

The keyword-expansion modes are listed in the "Keywords and Keyword Modes" section of Chapter 11.


-l

Run diff on the files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-r revision[:date]

Display the differences between the current sandbox copy and the specified revision. The date can be used only if the revision designates a branch, and specifies the latest revision on that date.

If two -r options are used, display the differences between the first and second specified revisions. One or both -r options can be replaced with -D.


-R

Run diff on the files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.6.2. Format options

These options determine how cvs diff displays any differences it finds. They represent the format-options portion of the syntax and operate in the same way as the options to the GNU diff program.


-number

Show number lines of context. This option is obsolete and should be replaced with either -C number or -U number. (If you do use it, this option must be combined with -c or -u.)


-a or --text

Compare files line by line, treating the files as text files.


-b or --ignore-space-change

Ignore trailing whitespace and consider all sequences of whitespace characters to be equivalent.


-B or --ignore-blank-lines

Ignore changes to blank lines, such as addition or deletion.


--binary

Read and write data in binary mode.


--brief

Report only whether the files are different, not how they are different.


-c or -C number or --context[=number]

Use context-output format, displaying number lines of context around each change. The default is two lines. If you are using diff to create a file to use with the patch program, you will need at least two lines of context.


-d or --minimal

Use an algorithm that is slower but tries to express the differences between the files in the fewest possible steps, sometimes creating a smaller list of changes to be made than the standard algorithm does.


-e or --ed

Produce the output in the form of a script that you can run with the ed text editor to convert the first revision to the second.


-f or --forward-ed

Produce output that is similar to an ed script, but with the changes in the order in which they occur in the file. The resulting output is not a script; it is simply in a format similar to an ed script.


-F re or --show-function-line=re

For each set of differences, show the most recent line that matches the regular expression re. See Chapter 11 for information on regular expressions.


-H or --speed-large-files

Use heuristics that help make diff faster if it is reading large files with many scattered, small changes.


--horizon-lines=number

If the files have a common header and footer, display the last number lines of the header and the first number lines of the footer.


-i or --ignore-case

Do not report on changes of letter case. Consider upper- and lowercase letters as identical.


-I re or --ignore-matching-lines=re

Do not report on changes that insert or delete lines that match the regular expression re.


--ifdef=NAME

Produce a merged file as output, with C preprocessor #ifdef=NAME structures around the differences. This option is particularly useful if you can compare a version of a C (or related) program that has just had a feature added, to the version just before the feature was added (and nothing but the feature has changed). If you have coded it with this in mind, this allows you to toggle the feature at compile time, with a #define.


-L label or --label label

Use label instead of the filename in the diff output headers.


--left-column

(Side-by-side output only.) Where the lines are the same, display only the line in the left column.


-n or --rcs

Produce a diff in RCS format rather than GNU format.


-N or --new-file

If directories are being compared and a file is not found in one directory, treat the file as if it were there but empty.


-p or --show-c-function

In the output, display the name of the C function each change is in. (Useful only if the files are written in C or related languages.)


-s or --report-identical-files

Report files that are identical.


--suppress-common-lines

In side-by-side format, do not display lines that are the same.


-t or --expand-tabs

Display the output with spaces instead of tabs.


-T or --initial-tab

Prepend a tab to the output to ensure that all subsequent tabs line up properly.


-u or -U number --unified[=number]

Use unified-output format, displaying number lines of context around each change. The default is two lines.


-w or --ignore-all-space

Ignore all differences in whitespace.


-W number or --width=number

Produce side-by-side output that is no more than number columns wide.


-y or --side-by-side

Use side-by-side output format.

10.2.6.3. Line and group format options

Line and group formats allow you to modify the way diff displays line changes. The group format options control the markers that surround the change, and the line format options control the marks on the changed lines themselves. Group format options are often used to create if-then-else structures for automated parsers to use.

The format options have a format string as a parameter and display the lines they affect according to the rule provided in the format string. The format string usually contains characters that are interpreted by your operating system's shell, so the string usually needs to be surrounded by your shell's quote character.

Following are the group format options, which affect the markers surrounding changed lines:


--old-group-format=format-string

Display the text defined by the format-string for each group of lines from the first file that are different or missing in the second file.


--new-group-format=format-string

Display the text defined by the format-string for each group of lines from the second file that are different or missing in the first file.


--changed-group-format=format-string

Display the text defined by the format-string for each group of lines that are different between filesusually a concatenation of the old and new group format strings.


--unchanged-group-format=format-string

Display the text defined by the format-string for each group of lines that are the same in both files.

Following are the line format options, which affect the lines themselves:


--old-line-format=format-string

Display the text defined by the format-string for each line from the first file that is different or missing in the second file.


--new-line-format=format-string

Display the text defined by the format-string for each line from the second file that is different or missing in the first file.


--unchanged-line-format=format-string

Display the text defined by the format-string for each line that is the same in both files.


--line-format=format-string

Display the text defined by the format-string for all lines.

The format-string for both group and line formats uses the percent character (%) as a special token, denoting a string to be evaluated by cvs diff. The string %% represents a single percent character. You also need to know your shell's escaping rules if you wish to include your shell's quote marks in the format string.

These are the special characters for a line format-string:


%l

The contents of the line to be formatted, not including the newline character.


%L

The contents of the line to be formatted, including the newline character. If a line does not contain a newline character, this character does not add it.


%[-][width][.[digits]][doxX]n

A printf-style format-string that displays the line number of the current line. The hyphen (-) signals that the number should be left-justified. The width specifies the minimum field width, and the digits specifies the minimum number of digits. The other options are d (for decimal), o (for octal), and x or X (for lower- or uppercase hexadecimal).


%%

The percent character.


%c'C'

The character C, which cannot be a quote or a backslash.


%c'\O'

The character represented by the octal string O.

These are the special characters for a group format-string:


%<

The lines from the first file.


%>

The lines from the second file.


%=

Lines common to both files.


%[-][width][.[digits]][doxX]symbol

A printf-style format-string that displays the number denoted by the symbol. The hyphen (-) signals that the number should be left-justified. The width specifies the minimum field width, and the digits specifies the minimum number of digits. The other options are d (for decimal), o (for octal), and x or X (for lower- or uppercase hexadecimal).

Lowercase symbols denote the first file. Uppercase symbols denote the second file. The symbols are:


E or e

The line number of the line just before the group.


F or f

The line number of the first line in the group.


L or l

The line number of the last line in the group.


M or m

The line number of the line just after the group.


N or n

The number of lines in the group.


%(A=B?C:D)

If A is equal to B, display C; otherwise, display D. A and B must be decimal constants or a single letter that is one of the symbols provided.


%%

The percent character.


%c'C'

The character C, which cannot be a quote or a backslash.


%c'\O'

The character represented by the octal string O.

10.2.6.4. Example 1

This is a simple example to show how CVS displays the difference between the current and repository revisions of the Makefile:

 jenn@soldier:~/wizzard$ cvs diff Makefile jenn@blackrock's password: Index: Makefile =================================================================== RCS file: /var/lib/cvs/wizzard/Makefile,v retrieving revision 1.17 diff -r1.17 Makefile 15d14 < testtesttesttes 30a30,32 > install: >                       scp wizzard /usr/local/bin >                       scp wizzard-doc /usr/local/man/wizzard 

10.2.6.5. Example 2

This example is more complicated. It shows how to use cvs diff with group format strings. No revisions are specified, so CVS compares the repository and current sandbox revisions of the cvs_admin.html file. The --old-group-format option and the format string specified with it cause sets of lines from the older revision that are changed in the new revision to be surrounded by #ifdef OLD and #else. The --new-group-format option and its format string put #endif after sets of lines from the new revision. The quotes around the format strings prevent my shell from interpreting the strings.

 jenn@soldier:~/oreilly/articles/cvs$ cvs diff \ > --old-group-format="#ifdef%c'\040'OLD%c'\012'%<%c'\012'#else%c'\012'" \ > --new-group-format="%>%c'\012'#endif%c'\012'" cvs_admin.html Index: cvs_admin.html ============================= RCS file: /var/lib/cvs/oreilly/articles/cvs/cvs_admin.html,v retrieving revision 1.16 diff --old-group-format=#ifdef%c'\040'OLD%c'\012'%<%c'\012'#else%c'\012' --new-group- format=%>%c'\012'#endif%c'\012' -r1.16 cvs_admin.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"    "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>CVS Administration</title> </head> <body>     <h1>CVS Administration</h1> <p> #ifdef OLD CVS - or Concurrent Versions System -  is a tool for saving the user's butt by maintaining a history of changes. It allows the retrieval of older versions of files, records who makes each change, and prevents simultaneous changes from overwriting each other. #else CVS - or Concurrent Versions System - is a tool for protecting the user from their own mistakes, by maintaining a history of changes. It allows you to fetch older versions of files, records which person makes each change, and prevents simultaneous changes from overwriting each other. #endif </p> <p> #ifdef OLD CVS expects the files it maintains to be stored in modules - directories of related files and subdirectories. A module can be as small as a single directory containing a single file, or as large as you have disk space for. #else CVS expects the files it maintains to be stored in projects - directories of related files and subdirectories. A project can be as small as a single directory containing a single file, or as large as you have disk space for. #endif </p> . . . 

10.2.7. edit

Synonyms: none

cvs [cvs-options] edit [-lR] [-a action...] [files...]

Marks a file as being edited by the current user.

See also editors, unedit, watch, and watchers.

10.2.7.1. Command options

-a action

Notify the user when the specified action occurs to the file. This setting acts as a temporary watch (see watch) on the file and is removed when the file is no longer being edited. Each -a designates one of the possible actions. The -a option can be repeated to designate multiple actions.

The action may be any of the following:


edit

Notify the user if someone else has run cvs edit on the file.


unedit

Notify the user when the file is no longer being edited by someone else. This notification is triggered by the user running cvs unedit or cvs release or by the file being deleted and recreated with cvs update or cvs checkout.


commit

Notify the user when someone else commits changes to the file.


all

Notify the user of all of the previous actions.


none

Notify the user of none of the previous actions.


-c

Causes cvs edit to fail if someone else is listed as editing the file. If the development team is using the watch system, commit and edit should both have the -c option in every user's .cvsrc.

Available only if both client and server are running 1.12.10 or later.


-f

Overrides the -c option, allowing cvs edit to work even if someone else is editing the file. Useful if edit -c is listed in the .cvsrc and the user is sure she's right to override the watch system.

Only available if both client and server are running 1.12.10 or later.


-l

Run edit on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run edit on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.7.2. Description

The cvs edit command is used as part of the cvs watch family of commands. If a file is being watched, it is checked out to the sandbox with read permissions but not write permissions. The edit command sets the sandbox file as writable, notifies any watchers that the file is being edited, and sets the user as a temporary watcher to be notified if certain actions are performed on the file by other users.

CVS does not notify you of your own changes.


You can unedit (set read-only and clear the temporary watch) a file with cvs unedit or cvs release, or by removing the file and recreating it with cvs update or cvs checkout.

CVS uses any script in the notify file in the repository's CVSROOT directory to notify the user of changes.

See Chapter 5 for an explanation of the watch system.

10.2.7.3. Example
 jenn@soldier:~/wizzard$$ cvs edit Makefile jenn@soldier:~/wizzard$$ 

10.2.8. editors

Synonyms: none

cvs [cvs-options] editors [-lR] [files...]

Displays the list of people who have a current edit command for the file or files listed as parameters. If no files are listed, this command lists the editors for the files in the current directory and subdirectories.

See Chapter 5 for an explanation of the watch system.

See also edit, unedit, watch, and watchers.

10.2.8.1. Command options

-l

Run editors on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run editors on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.8.2. Example
 jenn@soldier:~/wizzard$$ cvs editors Makefile Makefile jenn Sat Mar  4 04:42:35 2006 -0000 GMT helit /home/jenn/cvs/wizzard 

10.2.9. export

Synonyms: exp, ex

cvs [cvs-options] export [-flnNR] [-r revision] [-d directory-name] [-D date] [-k mode] [-r revision] project

Create a directory containing all directories and files belonging to a specified release of a project, with no CVS administrative files. You must specify a revision or date.

See also checkout and update.

10.2.9.1. Command options

-d directory-name

Export the project into a directory called directory-name instead of using the repository directory name or the name designated in the modules file in the repository's CVSROOT directory.

CVS usually creates the same directory structure that the repository uses. However, if the export contains only one file and -d is used, CVS does not create any intervening directories, thus shortening the directory path to the single file or directory. Use -N to prevent CVS from shortening the path.

For example, if the repository contains a project my, with a file at my/very/long/path/to/beachfront.txt, and you use checkout -d beach my/very/long/path/to/beachfront.txt, CVS will produce a sandbox beach containing only beachfront.txt.

If you use checkout -N -d beach my/very/long/path/to/beachfront.txt, CVS will produce a sandbox beach containing the entire directory chain very/long/path/to, with beachfront.txt in the directory to.


-D date

Export the latest revision of each file in a project that is older than the date or time specified by date. This option implies the -P option.


-f

Use the latest (HEAD) revision on the current branch or trunk of a project if no revision matches the date or revision number. This option applies only if -r or -D is used.


-k mode

Export a release with the designated keyword-expansion mode. This option overrides the default mode for each file. Prior to CVS 1.12.2, the -k option overrides the default mode for each file. After that version of CVS, -kb will not be overridden.

The keyword-expansion modes are listed in the "Keywords and Keyword Modes" section of Chapter 11.


-l

Run export on the files in the local directory only. (Do not recurse into subdirectories.)

See also -R.


-n

Do not run any program listed in the relevant line of the modules file in the repository's CVSROOT directory.


-N

Do not shorten the path. CVS usually creates the same directory structure that the repository uses. However, if the export contains only one file and -d is used, CVS does not create any intervening directories unless -N is also specified.


-r revision[:date]

Run export on the specified revision or tag of each file in a project. If this revision or tag refers to a branch, run the command on the latest (HEAD) revision of the branch. This option implies the -P option.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run export on the directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.9.2. Description

The cvs export command creates the directories and files that belong to a project as of a specific tagged release, revision number, or date. It acts like a checkout or update for that specific point, but it does not produce the CVS administrative files. export requires the -r or -D command options.

When exporting, the repository path must be specified by using the -d repository_path CVS option or the CVSROOT environment variable.

You can imply the repository path by being in a sandbox, but exporting into a sandbox is not recommended.


The argument to export can be a directory name or path within the repository, a filename or path within the repository, or a module name as specified in the modules file in the repository's CVSROOT directory.

10.2.9.3. Example
 jenn@soldier:/tmp$ cvs -d :ext:blackrock:/var/lib/cvs export -D now wizzard cvs export: Updating wizzard U wizzard/Changelog U wizzard/INSTALL U wizzard/Makefile U wizzard/README U wizzard/TODO cvs export: Updating wizzard/doc cvs export: Updating wizzard/doc/design U wizzard/doc/design/AcceptanceTest.doc U wizzard/doc/design/Analysis.rtf U wizzard/doc/design/Design.rtf U wizzard/doc/design/Requirements.doc U wizzard/doc/design/Specification.rtf cvs export: Updating wizzard/doc/plan U wizzard/doc/plan/Schedule.rtf 

10.2.10. history

Synonyms: hi, his

cvs [cvs-options] history [-aceloTw] [-b string] [-D date] [-f file] [-m module] [-n module] [-p directory] [-r revision] [-t tag] [-u username] [-x flag...] [-z timezone] [files...]

Displays the information stored in the history file in the repository's CVSROOT directory. The values of the CVSROOT/config file options LogHistory, HistoryLogPath, and HistorySearchPath affect what is stored in the history file, and where the file is.

To record changes, the file must be writable by all users who will run the commands that are to be logged. The users who run the history command must be permitted to read the history file.

The -f, -l, -n, and -p options for cvs history act differently than their normal uses in CVS.


10.2.10.1. Command options

-a

Show history data for all users. By default, CVS shows only the data for the calling user.


-b string

Show data that is more recent than the newest record that contains the given string in the module name, filename, or repository path.


-c

Report only commitstimes when the repository was modified (equivalent to -xAMR).


-D date

Report data that is more recent than the given date or time. (See "Dates" in Chapter 11 for legal dates.)


-e

Report on every record type. This option is equivalent to -x with every type specified.


-f file

Show data for the specified file. This option can be repeated to show data for multiple files.


-l

Show only the most recent commit to the repository.


-m module or -n module

Show data for a particular module. Using -m, CVS checks the modules file in the repository's CVSROOT directory and then searches the history file for files and directories that belong to the module. Using -n, CVS searches only the history file for the specified module name.


-o

Report on records of checkouts (equivalent to -xO). The default case is to report only on checkouts.


-p directory

Show records for a particular project directory. This option can be repeated to show records for several projects.


-r revision

Show data as of, or more recent than, the revision or tag. CVS searches the repository's project files to determine the timestamp of the revision.


-t tagname

Show data as of, or more recent than, the latest time a tag record with this tagname was stored in the history file by any user.


-T

Report on records of tags (equivalent to -xT).


-u username

Report on records for the specified username. This option can be repeated to search for multiple users.


-w

Report on records of actions that match the current working directory.


-x [ACEFGMORTUW]

Extract records that match the given flag or flags. Any number of flags can be used with the -x option. cvs history extracts all records in the history file that match this option and all other options. The flags may be any of the following:


A

Report on records of files added to the repository.


C

Report on records of files that would have been updated in a sandbox, but where the files needed to be merged and there were conflicts in the merge.


E

Report on records of files exported from the repository.


F

Report on records of files that were released.


G

Report on records of files updated in a sandbox with a successful merge.


M

Report on records of files that were modified (a sandbox revision added to the repository).


O

Report on records of files that were checked out.


P

Report on records of files that were patched in the sandbox.


R

Report on records of files that were removed from the repository.


T

Report on records of files that were rtagged.


U

Report on records of files updated in a sandbox file with no merge required.


W

Report on records of files deleted from a sandbox during an update because they were no longer active in the repository.


-z timezone

Produce output and convert times to the specified timezone. The best way to give a time zone is as an offset of UTC. Time is discussed in Chapter 11.

10.2.10.2. Example 1
 bash-2.05a$ cvs history O 2006-10-03 08:33 +0000 jenn wizzard/src =wizmain=     <remote>/* O 2006-10-03 09:12 +0000 jenn wizzard     =wizmake=     <remote>/* O 2006-10-03 09:12 +0000 jenn wizzard/src =wiztest=     <remote>/* O 2006-10-25 08:58 +0000 jenn wizzard     =wizzard=     <remote>/* 

10.2.10.3. Example 2
 jenn@soldier:~/wizzard$ cvs history -e O 2006-03-03 16:07 +0000 jenn wizzard       =wizzard=      <remote>/* A 2006-03-03 16:17 +0000 jenn 1.1            acconfig.h   wizzard/lib   == <remote> A 2006-03-03 16:17 +0000 jenn 1.1            getdate.h    wizzard/lib   == <remote> A 2006-03-03 16:17 +0000 jenn 1.1            gettext.h    wizzard/lib   == <remote> A 2006-03-03 16:17 +0000 jenn 1.1            utils.h      wizzard/lib   == <remote> O 2006-03-03 16:27 +0000 jenn zebedee       =zebedee=      <remote>/* O 2006-03-03 16:42 +0000 jenn [beta_0-1_branch] wizzard  =beta_0-1_branch= <remote>/* M 2006-03-03 17:02 +0000 jenn 1.1.6.1          README       wizzard      == <remote> 

10.2.11. import

Synonyms: im, imp

cvs [cvs-options] import [-b branch] [-d] [-I ignore] [-k mode] [-m message] [-W wrapper] project-name vendor-tag release-tag

Creates a new project in the repository or manages vendor branches.

10.2.11.1. Command options

-b branch

Import to the specified vendor branch. If you have more than one external supplier for a project, you may need to use two or more distinct vendor branches to manage the project. If you are using multiple vendor branches, use the -b option to specify which branch you are importing to. branch must be the branch number, not a tag, and CVS does not check that the branch number given with the option and the symbolic tag provided as the vendor-tag argument to the command correspond to the same branch.

I strongly recommend that you read "Vendor Branches" in Chapter 7 before using this option.


-d

When setting the timestamp on each imported file, use each file's last modification time rather than the current time.


-I ignore

Ignore the named file when updating. -I can be used more than once. Use -I ! to clear the list of ignored files. See "cvsignore" in Chapter 6.


-k mode

Import the file or files with the designated keyword-expansion mode. This option also sets the default keyword mode for the file. If you forget to set the default keyword mode with cvs import, you can do it later with cvs admin.

The keyword-expansion modes are listed in "Keywords and Keyword Modes" in Chapter 11.


-m message

Use the message when committing a file. CVS does not call the editor the next time cvs commit runs.


-W wrapper

Modify the import based on elements of each filename. Wrappers are explained in Chapter 3.


-X

Import any new files only to the vendor branch. (Default is to import them to the vendor branch and also add them to the trunk.) (CVS 1.12.10 and later.)

10.2.11.2. Description

To create a new project, lay out the project structure and any initial files. You can do this in a temporary directory, as CVS does not need the initial structure or files once the project has been imported. Change directories into the root directory of the new project, then run cvs import. You need to specify the repository path and provide a project name and two tags: a vendor tag and a release tag.

Test that you can cvs checkout the new project before removing the original files.

From 1.11.14, import will ignore files or directories named CVS.


The project name will become the project's root directory name. The tags are less critical; if you do not intend to use a vendor branch, a meaningless pair of tags such as a1 b2 is sufficient. The tag names must conform to all the normal requirements for tags: they must start with a letter and can contain only alphanumeric characters, underscores (_), and hyphens (-). The HEAD and BASE tag names are reserved.

A vendor branch is a special branch that CVS provides to track third-party code that contributes to a project. If you use vendor branches, CVS uses the vendor tag as a branch tag for the vendor branch, and it uses the release tag to mark the current revisions of the vendor branch files.

Create a vendor branch by using cvs import to create the project. When you want to update to a new release from the vendor, run cvs import on the same project with the same vendor tag and a new release tag. See Chapter 7 for a full explanation of vendor branches.

In Example 2 below, the wrapper ensures that the *.doc files are imported as binary files. Everything else is imported normally.

10.2.11.3. Example 1
 bash-2.05a$ cvs -d cvs:/var/lib/cvs import wizzard wizproject ver_0-1 N wizzard/Changelong N wizzard/INSTALL N wizzard/Makefile . . . "/tmp/cvsfaQoRz" 5L, 287C written No conflicts created by this import 

10.2.11.4. Example 2
 jenn@soldier:/tmp/wizzard$ cvs -d :ext:blackrock:/var/lib/cvs import \ > -W"*.doc -k 'b'" wiztwo wizproject ver_2-0 N wiztwo/Changelog N wiztwo/INSTALL N wiztwo/Makefile N wiztwo/README N wiztwo/TODO cvs import: Importing /var/lib/cvs/wiztwo/doc cvs import: Importing /var/lib/cvs/wiztwo/doc/design N wiztwo/doc/design/AcceptanceTest.doc N wiztwo/doc/design/Analysis.rtf N wiztwo/doc/design/Design.rtf N wiztwo/doc/design/Requirements.doc N wiztwo/doc/design/Specification.rtf cvs import: Importing /var/lib/cvs/wiztwo/doc/plan N wiztwo/doc/plan/Schedule.rtf cvs import: Importing /var/lib/cvs/wiztwo/lib N wiztwo/lib/acconfig.h N wiztwo/lib/getdate.h N wiztwo/lib/gettext.h N wiztwo/lib/utils.h cvs import: Importing /var/lib/cvs/wiztwo/src N wiztwo/src/config.h N wiztwo/src/handheld.c N wiztwo/src/server.c N wiztwo/src/server.cc N wiztwo/src/server2.cc N wiztwo/src/wizzard.c No conflicts created by this import 

10.2.12. init

Synonyms: none

cvs [cvs-options] init

Converts an existing directory into a CVS repository and creates and populates the CVSROOT directory that contains the administrative files for a CVS repository.

CVS creates the final directory in the path if it does not already exist. Previous directories in the path must exist. See Chapter 6 for more details.

10.2.12.1. Example
 $ cvs -d /var/lib/cvsroot init $ 

10.2.13. kserver

Synonyms: none

cvs [cvs-options] kserver

Runs the repository-server end of a Kerberos 4 connection. The cvs kserver command must be called from inetd or an equivalent server daemon. See Chapter 8 for more details.

See also pserver.

10.2.13.1. Example
 #inetd.conf #:OTHER: Other services 1999 stream tcp nowait root /usr/bin/cvs cvs -f --allow-root=/var/lib/cvsroot kserver 

10.2.14. log

Synonym: lo

cvs [cvs-options] log [-bhlNRSt] [-d dates] [-r[revisions]] [-s states] [-w[usernames]] [files...]

Displays information about the files specified as parameters, or, if none are given, about the files in the current sandbox. The information this command provides is part of the metadata stored in the files in the repository, and the log messages created when files are imported or added, or changes are committed.

Dates and times are displayed in local time for the client, if the server is 1.12.9 or later and the client is 1.12.10 or later. Prior to that, they were given in UTC.

It's worth experimenting with option combinations, to learn which are useful and which aren't. For example, at first it seems that the options which specify revisions are useless in combination with options that prevent revision information from showing. However, if you add -S as well, you can get the header information from only the files which match the specified revisions.

With no options, cvs log displays all the information it has available. See also rlog.

10.2.14.1. Command options

-b

Display information only about the revisions on the default branch, normally the most recent branch on the trunk.


-d dates

Display information only on revisions checked in on or between the dates or times provided. Date and time formats are listed in Chapter 11. More than one date range can be given; ranges must be separated by semicolons. Date ranges can be specified according to the following list:


date1>date2 or date2<date1

Select all revisions between the two dates.


date1>=date2 or date2<=date1

Select all revisions on or between the two dates.


date> or <date

Select all revisions earlier than date.


date>= or <=date

Select all revisions on or earlier than date.


date< or >date

Select all revisions later than date.


date<= or >=date

Select all revisions on or later than date.


date

Select all revisions on date.


-h

Print only the header information for a file, not the description, the log messages, or revision information.


-l

Run log on the local directory only. (Do not recurse down subdirectories.)


-N

Do not list the tags (the symbolic names).


-r[revisions]

Provide information only on revisions in the ranges provided. More than one range can be given; ranges must be separated by commas. There must be no space between the -r and its argument. If no range is provided, the latest revision on the default branch, normally the trunk, is used.

Ranges can be specified according to the following list:


revision1:revision2 or revision1::revision2

Select all revisions between revision1 and revision2. The revisions must be on the same branch. With the double colon, CVS excludes revision1.


:revision or ::revision

Select revisions from the start of the branch or trunk the revision is on, up to and including the revision.


revision: or revision::

Select revisions from revision to the end of the branch or trunk the revision is on. With the double colon, CVS excludes the revision.


branch

Select all revisions on branch.


branch1:branch2 or branch1::branch2

Select all revisions on both branches and any branches that split off from the two branches.


branch.

Select the latest revision on branch.


-R

Display the name of the repository copy of a file only.

Note that the usual CVS behavior with -R is to recurse down directories. -R works differently with log and rlog.



-s states

Display only revisions with states that match one of the states in the comma-separated list.


-S

Do not display header information if there are no revisions to display.


-t

Print only the header information and description, not the log messages or revision information.


-w[usernames]

Display only revisions committed by the specified list of users. Provide the list of users as a comma-separated list. If no usernames are listed, the revisions committed by the current user are displayed. There can be no space between -w and its argument.

10.2.14.2. Example
 jenn@soldier:~/wizzard$ cvs log Changelog RCS file: /var/lib/cvs/wizzard/Changelog,v Working file: Changelog head: 1.2 branch: locks: strict access list: symbolic names:         ver_2-0: 1.1.1.1         wizzard: 1.1.1         alpha_1-6: 1.1         alpha_1-5: 1.1         beta_0-1_branch: 1.1.0.2         beta_0-1_branch_root: 1.1         pre_beta_0-1: 1.1 keyword substitution: kv total revisions: 3;     selected revisions: 3 description: ---------------------------- revision 1.2 date: 2006-03-04 00:38:53 +1100;  author: jenn;  state: Exp;  lines: +0 -0; Testing keyword substitution modes. ---------------------------- revision 1.1 date: 2006-08-31 23:37:56 +1000;  author: jenn;  state: Exp; branches:  1.1.1; Creating a structure. ---------------------------- revision 1.1.1.1 date: 2006-01-06 23:39:45 +1100;  author: jenn;  state: Exp;  lines: +0 -0; Providing an example of vendor branches. ============================================================================= 

10.2.15. login

Synonyms: none

cvs [cvs-options] login

Logs in to a CVS pserver session. This command is needed only with the pserver connection mode. See Chapter 8 for more information.

See also logout.

10.2.15.1. Example
 jenn@soldier:~/wizzard$ cvs -d \ > :pserver:jenn:password:@cvs.nosuch.net:/var/lib/cvs login Logging in to :pserver:jenn@cvs:2401/var/lib/cvs 

10.2.16. logout

Synonyms: none

cvs [cvs-options] logout

Logs out of a CVS pserver session. This command is needed only with the pserver connection mode. See Chapter 8 for more information.

See also login.

10.2.16.1. Example
 jenn@soldier:~/wizzard$ cvs -d :pserver:jenn@cvs:/var/lib/cvs logout Logging out of :pserver:jenn@cvs:2401/var/lib/cvs 

10.2.17. ls

Synonyms: dir, list

cvs [cvs-options] ls [-e | -l] [-RP] [-r revisions] [-D dates] [files...]

List the files and directories in the repository directory that corresponds to the current working directory (which must be in a sandbox). This is almost identical to what would be in the current sandbox directory after an update, but doesn't include files or directories which are local.

If you specify a filename or directory as a parameter to cvs ls, it will list the specified file or directory as it exists in the repository. These parameters should be given relative to the current working directory.

See also rls.

10.2.17.1. Command options

-d

List "dead" revisions, i.e., revisions which have been cvs removed.


-D date

List files as they were at the date or time specified by date.


-e

Display the output in the format used in the CVS/Entries file. (See Chapter 6 for information on this file.)


-l

List files in long form.


-P

Do not include empty directories in the output.


-r revision[:date]

List files which belong to the specified revision or tag. If this option refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

List the local (or specified) directory and all subdirectories and recurse down the subdirectories. The default is to list only the local or specified directory.

10.2.17.2. Example 1
 jenn@soldier: ~/wizzard$ cvs ls -l ---- 2006-03-04 00:38:53 +1100 1.2        Changelog ---- 2006-03-04 00:38:53 +1100 1.2        INSTALL ---- 2006-08-08 08:36:19 +1000 1.17       Makefile ---- 2006-03-04 04:05:15 +1100 1.6        README ---- 2006-03-04 00:38:53 +1100 1.2        TODO d--- 2006-03-04 04:37:36 +1100            doc d--- 2006-03-04 04:37:36 +1100            empty d--- 2006-03-04 04:37:36 +1100            lib d--- 2006-03-04 04:37:36 +1100            man d--- 2006-03-04 04:37:36 +1100            src 

10.2.17.3. Example 2
 jenn@soldier:~/wizzard$ cvs ls -e jenn@blackrock's password: /Changelog/1.2/Mon Mar  3 13:38:53 2006// /INSTALL/1.2/Mon Mar  3 13:38:53 2006// /Makefile/1.17/Thu Aug  7 22:36:19 2006// /README/1.6/Fri Mar  3 17:05:15 2006// /TODO/1.2/Mon Mar  3 13:38:53 2006// D/doc//// D/empty//// D/lib//// D/man//// D/src//// 

10.2.18. pserver

Synonyms: none

cvs [cvs-options] pserver [-c path]

Runs the repository-server end of a password server or Kerberos 5 (via the GSS-API) connection. This command must be called from inetd or an equivalent server daemon. See Chapter 8.

See also kserver.


-c path

The path to the config file. By default, this is in the CVSROOT directory. (CVS 1.12.13 and later.)

10.2.18.1. Example
 #inetd.conf #:OTHER: Other services 2401 stream tcp nowait root /usr/bin/cvs cvs -f --allow-root=/var/lib/cvsroot pserver 

10.2.19. rannotate

Synonyms: ra, rann

cvs [cvs-options] rannotate [-fFlR] [-D date] [-r revision] files...

Displays files with annotations about the last change of each line. The annotations give the editor and revision number of the latest revision. You can run rannotate without a sandbox, but you must have a repository specified if you do so. rannotate requires at least one filename, directory name, or module name from within the repository as an argument.

See also annotate.

10.2.19.1. Command options

-D date

Run rannotate on the latest revision of a file that is as old as or older than the date or time specified by date.


-f

Use the latest (HEAD) revision on the current branch or trunk if no revision matches the date or revision number. This applies only if -r or -D is used.


-F

Show annotations for binary files. (Note that binary files may have extremely long lines.)


-l

Run rannotate on files in the local directory only. (Do not recurse into subdirectories.)


-r revision[:date]

Run rannotate on the specified revision or tag of a file. If the revision or tag refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run rannotate on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

10.2.19.2. Example
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs rannotate wizzard/Makefile Annotations for wizzard/Makefile *************** 1.2          (jenn     01-Apr-06): # 1.2          (jenn     01-Apr-06): # Makefile for the Wizzard project 1.2          (jenn     01-Apr-06): # First created by J Vesperman, 1 April 2006 1.2          (jenn     01-Apr-06): # 1.17         (jenn     07-Apr-06): # Current revision $Revision$ 1.3          (jenn     12-Apr-06): # On branch $Name$ (not expanded if this is the trunk) 1.17         (jenn     12-Apr-06): # Latest change by $Author$ on $Date: 2006/Apr/12 22:25:48 $ 1.2          (jenn     01-Apr-06): # 1.4          (jenn     12-Apr-06): ## 

10.2.20. rdiff

Synonyms: pa, patch

cvs [cvs-options] rdiff [-flR] [-c|-u] [-s|-t] {-r revision|-D date} [-r revision2 | -D date2] [-V version] projects...

Creates output that can be redirected into a file and used with the GNU (or equivalent) patch program. The output goes to the standard output (stdout). rdiff operates directly from the repository and does not need to be used from a sandbox. It does require a filename, directory name, or module name as an argument, and you must specify one or two revisions or dates. If you specify one revision or date, rdiff calculates the differences between that date and the current (HEAD) revision. If two dates are specified, rdiff calculates the differences between the two.

See also diff.

Most people use rdiff to make a file to use with patch. If you're using a patch file that was created over more than one directory, you may need to use the -p option to patch, so it can find all the appropriate directories.


10.2.20.1. Command options

-c

Use context output format, with three lines of context around each change. This is the default format.


-D date

Display the differences between the current sandbox copy of a file and the latest revision as of the date or time specified by date. One or both -D options can be replaced with -r.


-f

Use the latest (HEAD) revision of a file on the current branch or trunk if no revision matches the date or revision number. This option applies only if -r or -D is used.


-k mode

Run diff with the designated keyword-expansion mode. This option overrides the default mode and any sticky modes for each file. It's useful to use -kk with diff, to avoid spurious differences being reported (such as expansion of the $Revision$ keyword).

The keyword-expansion modes are listed in "Keywords and Keyword Modes" of Chapter 11.


-l

Run rdiff on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-r revision[:date]

Display the differences between the current sandbox copy and the specified revision. The date can be used only if the revision designates a branch and specifies the latest revision on that date (the :date option is available as of 1.12.12).

If two -r options are used, display the differences between the first and second specified revisions. One or both -r options can be replaced with -D.


-R

Run rdiff on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.


-s

Create a summary change report rather than a patch, showing which files have changed with one line per file.


-t

Produce a report on the two most recent revisions in a file. Do not use -r or -D with the -t option.


-u

Use unidiff format instead of context format.


-V version

This option is now obsolete, but it used to allow you to expand keywords according to the rules of the specified RCS version.

10.2.20.2. Example
 jenn@soldier:~/wizzard$ cvs rdiff -r 1.5 wizzard/Makefile *** wizzard/Makefile:1.5        Thu Oct 17 08:50:14 2006 --- wizzard/Makefile    Fri Aug  8 08:36:19 2006 *************** *** 2,17 ****   # Makefile for the Wizzard project   # First created by J Vesperman, 1 September 2006   # ! # Current revision $Revision$   # On branch $Name$ (not expanded if this is the trunk) ! # Latest change by $Author$ on $Date$   #   ##   # Initial declarations   #   CC=gcc ! SUBDIRS = man doc src lib ping   # Declaring phony targets --- 2,18 ----   # Makefile for the Wizzard project   # First created by J Vesperman, 1 September 2006   # ! # Current revision $Revision$   # On branch $Name$ (not expanded if this is the trunk) ! # Latest change by $Author$ on $Date$   #   ##   # Initial declarations   #   CC=gcc ! SUBDIRS = man doc src lib ! oooofoooofooofoo   # Declaring phony targets *************** *** 23,28 **** --- 24,30 ----   clean:                         rm -f src/*.o +                       rm -f lib/*.o                         rm -f wizzard                         echo "clean: make complete" . . . 

10.2.21. release

Synonyms: re, rel

cvs [cvs-options] release [-d] directories...

Makes a sandbox inactive. This command checks for uncommitted changes, removing any existing edit flags, and writes to the CVSROOT/history file that the sandbox has been released. You can use release on an entire sandbox or on one or more subdirectories.

10.2.21.1. Command option

-d

Delete the sandbox after it has been released.

This command is recursive, and it deletes files and directories even if they have not been saved to the CVS repository. Use it carefully.


10.2.21.2. Example
 jenn@soldier:/tmp$ cvs -d :ext:blackrock:/var/lib/cvs release -d wiztwo You have [0] altered files in this repository. Are you sure you want to release (and delete) directory 'wiztwo': y 

10.2.22. remove

Synonyms: rm, delete

cvs [cvs-options] remove [-flR] [files...]

The remove command removes a file or directory from the repository record for the current revision of the current branch or trunk. Committed data for the file remains in the repository, and old revisions can be retrieved with update or checkout as normal.

Remove can also be used to undo an uncommitted file addition.

Unless you use the -f option, you must have already removed the file from the sandbox.

Any uncommitted changes are lost forever.


10.2.22.1. Command options

-f

Delete the files from the sandbox as well as removing them from the repository.


-l

Remove files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Remove files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

In Example 1, I remove a file which has been committed. In Example 2, I am undoing an unwanted addition that has not yet been committed.

10.2.22.2. Example 1
 jenn@soldier:~/wizzard/src$ cvs remove -f handheld.c cvs remove: scheduling 'handheld.c' for removal cvs remove: use 'cvs commit' to remove this file permanently 

10.2.22.3. Example 2
 jenn@soldier:~/wizzard/src$ cvs remove -f handheld.h cvs remove: removed 'handheld.h' 

10.2.23. rlog

Synonym: rl

cvs [cvs-options] rlog [-bhlNRSt] [-d dates] [-r[revisions]] [-s states] [-w[usernames]] files...

The rlog command is a remote version of the log command. rlog works without a sandbox and requires a file, directory, or module name from the repository.

See also log.

10.2.23.1. Command options

-b

Provide information only about the revisions or a file on the default branch, normally the highest branch on the trunk.


-d dates

Provide information only on revisions of a file that were checked in on or between the dates or times provided. Date formats are listed in Chapter 11. More than one date range can be given; ranges must be separated by semicolons. Date ranges can be specified according to the following list:


date1>date2 or date2<date1

Select all revisions between the two dates.


date1>=date2 or date2<=date1

Select all revisions on or between the two dates.


date> or <date

Select all revisions earlier than date.


date>= or <=date>

Select all revisions on or earlier than date.


date< or >date

Select all revisions later than date.


date<= or >=date

Select all revisions on or later than date.


date

Select all revisions on date.


-h

Print only the header information, not the description, log messages, or revision information.


-l

Run rlog on the local directory only. (Do not recurse into subdirectories.)


-N

Do not list the tags (the symbolic names).


-r[revisions]

Provide only information on revisions in the ranges provided. More than one revision range can be given; ranges must be separated by commas. There must be no space between the -r and its argument. If no range is provided, the latest revision on the default branch, normally the trunk, is used.

Ranges can be specified according to the following list:


revision1:revision2 or revision1::revision2

Select all revisions between revision1 and revision2. The revisions must be on the same branch. With the double colon, revision1 is excluded.


:revision or ::revision

Select revisions from the start of the branch or trunk the revision is on, up to and including the revision.


revision: or revision::

Select revisions from revision to the end of the branch or trunk it is on. With the double colon, the revision is excluded.


branch

Select all revisions on the branch.


branch1:branch2 or branch1::branch2

Select all revisions on both branches and any branches that split off between those two branches.


branch.

Select the latest revision on the branch.


-R

Display the name of the repository copy of the file only.

Note that the usual CVS behavior with -R is to recurse down directories. -R works differently with log and rlog.



-s states

Display only revisions with states that match one of the states in the comma-separated list.


-S

Do not display header information of a file if there are no revisions to display.


-t

Print only the header information of a file and its description, not the log messages or revision information.


-w[usernames]

Display only revisions committed by the usernames in the comma-separated list. If there are no usernames listed, the revisions committed by the current user are displayed. There can be no space between -w and its argument.

10.2.23.2. Example
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs rlog wizzard/src jenn@blackrock's password: ******** cvs rlog: Logging wizzard/src RCS file: /var/lib/cvs/wizzard/src/config.h,v head: 1.4 branch: locks: strict access list: symbolic names:         ver_2-0: 1.1.1.1         wizzard: 1.1.1         alpha_1-6: 1.3         alpha_1-5: 1.3         beta_0-1_branch: 1.1.0.2         beta_0-1_branch_root: 1.1         pre_beta_0-1: 1.1 keyword substitution: kv total revisions: 7;     selected revisions: 7 description: ---------------------------- revision 1.4 date: 2006-03-04 00:41:46 +1100;  author: jenn;  state: Exp;  lines: +0 -0; Yet more testing ---------------------------- revision 1.3 date: 2006-09-27 03:11:17 +1000;  author: jenn;  state: Exp;  lines: +5 -6; Trying to find the cvs process ---------------------------- revision 1.2 date: 2006-09-13 17:26:27 +1000;  author: jenn;  state: Exp;  lines: +3 -0; Minor tweaks to the config file. ---------------------------- revision 1.1 date: 2006-09-12 18:56:41 +1000;  author: jenn;  state: Exp; branches:  1.1.1;  1.1.2; Moving src/wizzard.h to src/config.h 

10.2.24. rls

Synonyms: rdir, rlist

cvs [cvs-options] ls [-e | -l] [-RP] [-r revisions] [-D dates] [files...]

List the files and directories in the repository directory specified, or list the specified files. Files and directories must be given relative to the repository root directory. If no directory is specified, the repository root directory is listed.

See also ls.


-d

List "dead" revisions, i.e., revisions which have been cvs removed.


-D date

List files as they were at the date or time specified by date.


-e

Display the output in the format used in the CVS/Entries file. (See Chapter 6 for information on this file.)


-l

List files in "long" form.


-P

Do not include empty directories in the output.


-r revision[:date]

List files which belong to the specified revision or tag. If this option refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

List the local (or specified) directory and all subdirectories and recurse down the subdirectories. The default is to list only the local or specified directory.

10.2.24.1. Example
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs rls cvs rls: Listing module: '.' CVSROOT cvstraining wiztwo wizzard wizzard-libs zebedee 

10.2.25. rtag

Synonyms: rt, rfreeze

cvs [cvs-options] rtag [-abBdfFlnR] {-D date|-r revision} tagname files...

Marks a revision of a single file with a meaningful name or marks a set of revisions of multiple files so that they can all be retrieved easily as a group.

See also tag.

10.2.25.1. Command options

-a

Clear a tag from files that have been removed from active development. Normally, removed files are not searched when tags are removed. This option works with the -d and -F options.


-b

Create a branch off the designated revision, using the designated tagname as the branch name. Chapter 4 explains branches and their uses.


-B

Allow -F and -d to act on branch tags.

Back up the repository before you use this option, and be extremely careful. I strongly recommend reading Chapter 4 before using this option.



-d tagname

Delete the specified tag. This removes the human-readable tagname. The revision that the tagname referred to remains in the file.

Do not delete branch tags unless you are absolutely certain you know what you're doing and have backed up your data: it can permanently corrupt the affected files.



-D date

Tag the latest revision of each file that is as old as or older than the date or time specified by date.


-f

Use the latest (HEAD) revision on the current branch or trunk if no revision matches the date or revision number.


-F tagname

Move the tag from the revision it currently refers to, to the revision specified in the rtag command.

Do not use this command on branch tags unless you are absolutely certain you know what you're doing and have backed up your data. Moving branch tags can permanently corrupt the affected files.



-l

Run rtag on files in the local directory only. (Do not recurse into subdirectories.)

See also -R.


-n

Do not run any program listed in the appropriate line of the modules file of the repository's CVSROOT directory.


-r revision[:date]

Run rtag on the specified revision or tag. If revision refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run rtag on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.25.2. Description

Use rtag to mark a revision of a single file with a meaningful name or to mark a set of revisions of multiple files so that they can all be retrieved easily as a group. Tagnames must begin with a letter and may contain only alphanumeric characters, underscores (_), and hyphens (-). There are two tags reserved for CVS: the BASE and HEAD tags.

The tag and rtag commands are also used to create branches. Branches and tags are explained in Chapter 4.

The rtag command does not need to run from a sandbox, but it does need to have a revision or date specified. It also requires a filename, directory name, or module name given as a parameter.

Example 1 adds the tag bing to the current (time now) revision of every file in the project wizzard. Example 2 removes that same tag.

10.2.25.3. Example 1
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs rtag -D now bing wizzard cvs rtag: Tagging wizzard cvs rtag: Tagging wizzard/doc cvs rtag: Tagging wizzard/doc/design cvs rtag: Tagging wizzard/doc/plan cvs rtag: Tagging wizzard/empty cvs rtag: Tagging wizzard/empty/design cvs rtag: Tagging wizzard/empty/plan cvs rtag: Tagging wizzard/lib cvs rtag: Tagging wizzard/man cvs rtag: Tagging wizzard/srcb 

10.2.25.4. Example 2
 jenn@soldier:~$ cvs -d :ext:blackrock:/var/lib/cvs rtag -d bing wizzard cvs rtag: Untagging wizzard cvs rtag: Untagging wizzard/doc cvs rtag: Untagging wizzard/doc/design cvs rtag: Untagging wizzard/doc/plan cvs rtag: Untagging wizzard/empty cvs rtag: Untagging wizzard/empty/design cvs rtag: Untagging wizzard/empty/plan cvs rtag: Untagging wizzard/lib cvs rtag: Untagging wizzard/man cvs rtag: Untagging wizzard/src 

10.2.26. server

Synonyms: none

cvs [cvs-options] server [-c path]

The server command is used internally by CVS; the server is invoked by the CVS client when the client connects to the repository computer via the ext or server access methods.

See also kserver and pserver.


-c path

The path to the config file. By default, this is in the CVSROOT directory. (CVS 1.12.13 and later.)

10.2.27. status

Synonyms: st, stat

cvs [cvs-options] status [-vlR] [files...]

Displays information about files, such as the current working or base revision, the current revision in the repository, and whether the files are currently synchronized with the repository. With the -v option, status also shows the files' tags.

10.2.27.1. Command options

-l

Run status on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run status on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.


-v

Include information about tags.

10.2.27.2. Example
 jenn@soldier:~/wizzard$ cvs status Makefile ============================= File: Makefile              Status: Locally Modified    Working revision:    1.6    Repository revision: 1.6     /var/lib/cvs/wizzard/Makefile,v    Sticky Tag:          (none)    Sticky Date:         (none)    Sticky Options:      (none) 

10.2.28. tag

Synonyms: ta, freeze

cvs [cvs-options] tag [-bcdfFlR] [-D date|-r revision] tagname [files...]

Marks a revision of a single file with a meaningful name or marks a set of revisions of multiple files so that they can all be retrieved easily as a group.

See also rtag.

10.2.28.1. Command options

-b

Create a branch off the specified revision, using the specified tagname as the branch name. Chapter 4 explains branches and their uses.


-c

Check whether the sandbox copies of the specified files have been modified since they were last synchronized with the repository. If they have been modified, do not tag them, and display an error. If they are unmodified, tag them with the specified tagname. This option is useful when tagging the current sandbox revisions.


-d tagname

Delete the specified tagname from a file. (This option removes the human-readable tagname; the revision that the tagname used to refer to remains in the file.)

Do not delete branch tags unless you are absolutely certain you know what you're doing it can permanently corrupt the affected files.



-D date

Tag the latest revision of each specified file that is as old as or older than the date or time specified by date.


-f

Use the latest (HEAD) revision on the current branch or trunk if no revision matches the date, time, tag, or revision number. This applies only if -r or -D are used.


-F tagname

Move the tagname from the revision it currently refers to, to the revision specified in the tag command.

Do not use this command on branch tags unless you are absolutely certain what you're doing, and have backed up your data. Moving branch tags can permanently corrupt the affected files.



-l

Run tag on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-r revision[:date]

Run tag on the specified revision or tag. If revision refers to a branch, run the command on the latest (HEAD) revision of the branch.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run tag on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.28.2. Description

Use the tag command to mark a revision of a single file with a meaningful name or to mark a set of revisions of multiple files so that they can all be retrieved easily as a group. Tagnames must begin with a letter and may contain only alphanumeric characters, underscores (_), and hyphens (-). There are two tags reserved for CVS: the BASE and HEAD tags.

The tag and rtag commands are also used to create branches. Branches and tags are explained in Chapter 4.

If no revision number or date is given to the tag command, this command tags based on the most recent revision in the repository that was synchronized with the current sandbox directory (i.e., the most recently updated, checked-out, or committed revision). This revision can be seen as the working revision in the cvs status command.

10.2.28.3. Example 1
 jenn@soldier:~/wizzard$ cvs tag alpha_1-5 cvs server: Tagging . T Changelog T INSTALL T Makefile T README T TODO . . . 

10.2.28.4. Example 2
 jenn@soldier:~/wizzard$ cvs tag -D now -F current jenn@blackrock's password: cvs tag: Tagging . T Changelog T INSTALL T Makefile T README T TODO . . . 

10.2.29. unedit

Synonyms: none

cvs [cvs-options] unedit [-lR] [files...]

Notifies watchers that a file is no longer being edited, clears the temporary watch, sets the file as read-only, and restores the file to the repository revision that the sandbox copy was based on.

See also edit, editors, watch, and watchers.

10.2.29.1. Command options

-l

Run unedit on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run unedit on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.29.2. Description

The cvs unedit command is used as part of the cvs watch family of commands. If a file is being watched, CVS writes it (when it is checked out) to the sandbox with read permissions but not write permissions. The edit command sets the sandbox file as writable, notifies any watchers that the file is being edited, and sets the user as a temporary watcher to be notified if certain actions are performed on the file by other users.

The unedit command notifies watchers that the file is no longer being edited, clears the temporary watch, sets the file as read-only, and restores the file to the repository revision that the sandbox copy was based on.

The script in the notify file in the repository's CVSROOT directory is used to notify the user of changes.

See Chapter 5 for an explanation of the watch system.

10.2.29.3. Example
 jenn@soldier:~/wizzard$ cvs unedit Makefile jenn@soldier:~/wizzard$ 

10.2.30. update

Synonyms: up, upd

cvs [cvs-options] update [-ACdflpPR] [-D date] [-I ignore] [-j revision [:date]] [-j revision2 [:date2]] [-k mode] [-r revision] [-W wrapper] [files...]

Downloads changes from the repository to an existing sandbox.

See also checkout and export.

10.2.30.1. Command options

-A

Clear sticky tags, dates, and keyword-expansion modes and replace the current files in a sandbox with the head of the trunk.


-C

Replace any file that has been changed locally with the revision from the repository that the local file was based on. The modified local file is saved as .#file.revision in its local sandbox directory.


-d

Create any directories that are in the repository but not in the sandbox. By default, update works only on the directories that are currently in the sandbox and ignores any new directories.


-D date

Check out the latest revision of each file that is as old as or older than the date or time specified by date. This option produces a sticky date on the new sandbox. This also implies the -P option.


-f

Use the latest (HEAD) revision on the current branch or trunk if no revision matches the date, time, tag, or revision number. This applies only if -r or -D are used.


-I file_to_ignore

Ignore the named file when updating. -I can be used more than once. Use -I ! to clear the list of ignored files. See "cvsignore" in Chapter 6.


-j revision[:date]

Determine the older of the revision the files in the sandbox are based on and the specified revision, then determine the changes between that older revision and the revision specified, and merge those changes to the sandbox.

If two -j options are used, determine the changes between the first -j revision and the second -j revision and merge those changes to the sandbox.

The date can be used only if the revision designates a branch. If date is used, it specifies the latest revision on (not before) that date.

From 1.12.12, you can use :date (with no revision) to specify a particular date on the trunk.


-k mode

Update the files or sandbox with the designated keyword-expansion mode. This option also sets a sticky keyword mode for the files or the sandbox so that later commands operate with the same keyword-expansion mode unless a -k option overrides that mode. Prior to CVS 1.12.2, the -k option overrides the default mode for each file. After that version of CVS, -kb will not be overridden.

The keyword-expansion modes are listed in "Keywords and Keyword Modes" in Chapter 11 and are explained in "Keywords" in Chapter 3.


-l

Run update on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-p

Update the listed files, but write them to the standard output (stdout) rather than to the filesystem. Do not change the sandbox.


-P

Do not include empty directories in the sandbox.


-r revision[:date]

Run update on the specified revision or tag. If revision refers to a branch, run the command on the latest (HEAD) revision of the branch. This option produces a sticky tag on the new sandbox.

The date can be used only if the revision designates a branch, and specifies the latest revision on that date (the :date option is available as of 1.12.12).


-R

Run update on the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.


-W wrapper

Modify the update based on elements of each filename. Wrappers are explained in Chapter 3.

10.2.30.2. Description

The cvs update command brings changes from the repository to an existing sandbox. While doing this, update merges changes from the repository into changed files in the sandbox.

If update cannot merge repository changes with sandbox changes without losing data, it reports a conflict. Resolving conflicts is explained in Chapter 3.

If update is not given any filenames or directory names as parameters, it acts on the current sandbox.

Example 2 was run on a sandbox containing the current trunk, and is an example of merging the branch back to the trunk. Someone will have to edit Makefile and resolve the conflicts.

10.2.30.3. Example 1
 jenn@soldier:~/wizzard$ cvs update cvs server: Updating . U wizzard/Changelog U wizzard/INSTALL U wizzard/Makefile . . . 

10.2.30.4. Example 2
 jenn@soldier:~/wizzard$ cvs update -j beta_0-1_branch_root -j beta_0-1_branch jenn@blackrock's password: ******** cvs update: Updating . RCS file: /var/lib/cvs/wizzard/Makefile,v retrieving revision 1.3 retrieving revision 1.3.2.2 Merging differences between 1.3 and 1.3.2.2 into Makefile rcsmerge: warning: conflicts during merge cvs update: Updating doc . . . 

10.2.31. version

Synonyms: ve, ver

cvs [cvs-options] version

Displays the version information for the current installation of CVS.

10.2.31.1. Example
 jenn@soldier:~/wizzard$ cvs version Client: Concurrent Versions System (CVS) 1.12.12 (client/server) Server: Concurrent Versions System (CVS) 1.12.12 (client/server) 

10.2.32. watch

Synonyms: none

cvs [cvs-options] watch {on|off|add|remove} [-lR] [-a action] [files...]

Sets files to be watched or adds users to the file watch list. Users who are watching a file are notified via the script in the notify file in the repository's CVSROOT directory when other users perform specific actions. Chapter 5 explains uses of the cvs watch family of commands.

CVS does not notify you of your own changes.


See also edit, editors, unedit, and watchers.

10.2.32.1. Command options

on and off

The on and off subcommands control whether the file or files are marked as being watched. If a file is marked as being watched, CVS sets it as read-only when it is checked out of the repository. Without this read-only setting, your developers might forget to use cvs edit when editing a file.

If the argument is a directory, all current files in the directory and all new files added to that directory in the future are set as being watched.

The on and off subcommands set whether a file is watchable, but they do not set who is watching it.


add and remove

Use the add and remove subcommands to set or remove files you want to watch. Use the -a option to specify which actions you want to be notified of.

The add and remove subcommands set whether or not you are watching a file.


-a action

Notify the user when the designated actions occur to the file. Each -a designates one possible action. The -a option can be repeated to designate multiple actions. The -a option is usable only with the add and remove subcommands.

These are the possible actions:


edit

Notify the user if someone else has run cvs edit on the file.


unedit

Notify the user when the file is no longer being edited by someone else. Notification occurs when cvs unedit or cvs release runs or when the file is deleted and recreated with cvs update or cvs checkout.


commit

Notify the user when someone else commits changes to the file.


all

Notify the user in all of the previous cases.


none

Notify the user in none of the previous cases.


-l

Run watch on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run watch on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.32.2. Example
 jenn@soldier:~/wizzard$ cvs watch on Makefile jenn@soldier:~/wizzard$ cvs watch add Makefile jenn@soldier:~/wizzard$ 

10.2.33. watchers

Synonyms: none

cvs [cvs-options] watchers [-lR] [files...]

Displays the list of users who are watching the files listed as parameters. If no files are listed, this command lists the watchers for the files in the current directory and its subdirectories.

See Chapter 5 for an explanation of the watch system.

See also edit, editors, unedit, and watch.

10.2.33.1. Command options

-l

Run watchers on files in the local directory only. (Do not recurse down subdirectories.)

See also -R.


-R

Run watchers on files in the local directory and all subdirectories and recurse down the subdirectories. This option is the default.

See also -l.

10.2.33.2. Example
 jenn@soldier:~/wizzard$ cvs watchers Makefile Makefile doppel edit unedit commit          jenn edit unedit commit 




Essential CVS
Essential CVS (Essentials)
ISBN: 0596527039
EAN: 2147483647
Year: 2006
Pages: 148

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net