ci |
ci [options] files
Check in revisions. ci stores the contents of the specified working files into their corresponding RCS files. Normally, ci deletes the working file after storing it. If no RCS file exists, then the working file is an initial revision. In this case, the RCS file is created and you are prompted to enter a description of the file. If the RCS file exists, ci increments the revision number and prompts you to enter a message that logs the changes made. If a working file is checked in without changes, the file reverts to the previous revision.
The mutually exclusive options -u, -l, and -r are the most common. Use -u to keep a read-only copy of the working file (for example, so that the file can be compiled or searched). Use -l to update a revision and then immediately check it out again with a lock. This allows you to save intermediate changes but continue editing (for example, during a long editing session). Use -r to check in a file with a different release number. ci accepts the standard options -q, -V, -x, and -z.
Check in chapter files using the same log message:
ci -m'First round edits' chap*
Check in edits to prog.c, leaving a read-only copy:
ci -u prog.c
Start revision level 2; refer to revision 2.1 as "Prototype":
ci -r2 -nPrototype prog.c
co |
co [options] files
Retrieve a previously checked-in revision, and place it in the corresponding working file (or print to standard output if -p is specified). If you intend to edit the working file and check it in again, specify -l to lock the file. co accepts the standard options -q, -V, -x, and -z.
Sort the latest stored version of file:
co -p file | sort
Check out (and lock) all uppercase filenames for editing:
co -l [A-Z]*
Note that filename expansion fails unless a working copy resides in the current directory. Therefore, this example works only if the files were previously checked in via ci -u. Finally, here are some different ways to extract the working files for a set of RCS files (in the current directory):
co -r3 *,v Latest revisions of release 3 co -r3 -wjim *,v Same, but only if checked in by jim co -d'May 5, 2 pm LT' *,v Latest revisions that were modified on or before the date co -rPrototype *,v Latest revisions named Prototype
ident |
ident [option] [files]
Extract keyword/value symbols from files. files can be text files, object files, or dumps.
If file prog.c is compiled, and it contains this line of code:
char rcsID[ ] = "$Author: ellie $";
then the following output is produced:
% ident prog.c prog.o prog.c: $Author: ellie $ prog.o: $Author: ellie $
Show keywords for all RCS files (suppress warnings):
co -p RCS/*,v | ident -q
rcs |
rcs [options] files
An administrative command for setting up or changing the default attributes of RCS files. Among other things, rcs lets you set strict locking (-L), delete revisions (-o), and override locks set by co (-l and -u). RCS files have an access list (created via -a); anyone whose username is on the list can run rcs. The access list is often empty, meaning that rcs is available to everyone. In addition, you can always invoke rcs if you own the file, if you're a privileged user, or if you run rcs with -i. rcs accepts the standard options -q, -V, -x, and -z.
Associate the label To_customer with the latest revision of all RCS files:
rcs -nTo_customer: RCS/*
Add three users to the access list of file beatle_deals:
rcs -ageorge,paul,ringo beatle_deals
Delete revisions 1.2 through 1.5:
rcs -o1.2-1.5 doc
Replace an RCS file description with the contents of a variable:
echo "$description" | rcs -t file
rcsclean |
rcsclean [options] [files]
Compare checked-out files against the corresponding latest revision or revision R (as given by the options). If no differences are found, the working file is removed. (Use rcsdiff to find differences.) rcsclean is useful in makefiles. For example, you could specify a "clean-up" target to update your directories. rcsclean is also useful prior to running rcsfreeze. rcsclean accepts the standard options -q, -V, -x, and -z.
Remove unchanged copies of program and header files:
rcsclean *.c *.h
rcsdiff |
rcsdiff [options] [diff_options] files
Compare revisions via diff. Specify revisions using -r as follows:
Number of revisions specified |
Comparison made |
---|---|
0 |
Working file against latest revision |
1 |
Working file against specified revision |
2 |
One revision against the other |
rcsmerge |
rcsmerge [options] file
Perform a three-way merge of file revisions, taking two differing versions and incorporating the changes into the working file. You must provide either one or two revisions to merge (typically with -r). Overlaps are handled the same as with merge, by placing warnings in the resulting file. rcsmerge accepts the standard options -q, -V, -x, and -z. rcsmerge exits with a status of 0 (no overlaps), 1 (some overlaps), or 2 (unknown problem).
Say you need to add updates to an old revision (1.3) of prog.c, but the current file is already at revision 1.6. To incorporate the changes:
co -l prog.c (edit latest revision by adding revision 1.3 updates, then:) rcsmerge -p -r1.3 -r1.6 prog.c > prog.updated.c
Undo changes between revisions 3.5 and 3.2, and overwrite the working file:
rcsmerge -r3.5 -r3.2 chap08
rlog |
rlog [options] files
Display identification information for RCS files, including the log message associated with each revision, the number of lines added or removed, date of last checkin, and so on. With no options, rlog displays all information. Use options to display specific items. rlog accepts the standard options -V, -x, and -z.
Display a file's revision history:
rlog RCS/*,v | more
Display names of RCS files that are locked by user daniel:
rlog -R -L -ldaniel RCS/*
Display the "title" portion (no revision history) of a working file:
rlog -t calc.c
Copyright © 2003 O'Reilly & Associates. All rights reserved.