HP-UX Reference (11i v3 07/02) - 5 Miscellaneous Topics (vol 9)
r
rcsintro(5) rcsintro(5)
Of course, it is too late now to do the check-out with locking, because you probably modified
f.c already,
and a second check-out would overwrite your modifications. Instead, invoke:
rcs -l f.c
This command will lock the latest revision for you, unless somebody else has already locked it. In that
case, you will have to negotiate with that person.
Locking assures that you, and only you, can check in the next update, and avoids nasty problems if several
people work on the same file. Even if a revision is locked, it can still be checked out for reading, compiling,
etc. All that locking prevents is a check-in by anybody but the locker.
If your RCS file is private, that is, if you are the only person who is going to deposit revisions into it, strict
locking is not needed and you can turn it off. If strict locking is turned off, the owner of the RCS file need
not have a lock for check-in; all others still do. Turning strict locking off and on is done with the com-
mands:
rcs -U f.c
and
rcs -L f.c
If you do not want to clutter your working directory with RCS files, create a subdirectory called
RCS in
your working directory, and move all your RCS files there. RCS commands will search that directory to
find needed files. All the commands discussed above will still work without any modification.
To avoid the deletion of the working file during check-in (in case you want to continue editing), invoke:
ci -l f.c
or
ci -u f.c
These commands check in f.c as usual, but perform an implicit check-out. The first form also locks the
checked-in revision, the second one does not. Thus, these options save you one check-out operation. The
first form is useful if locking is strict; the second one if not strict. Both update the identification markers in
your working file (see below).
You can give ci the number you want assigned to a checked in revision. Assume all your revisions were
numbered 1.1, 1.2, 1.3, etc., and you would like to start release 2. The command:
ci -r2 f.c
or
ci -r2.1 f.c
assigns the number 2.1 to the new revision. From then on, ci will number the subsequent revisions with
2.2, 2.3, etc. The corresponding
co commands:
co -r2 f.c
and
co -r2.1 f.c
retrieve the latest revision numbered 2.x and the revision 2.1, respectively. co without a revision number
selects the latest revision on the "trunk"; that is, the highest revision with a number consisting of 2 fields.
Numbers with more than 2 fields are needed for branches. For example, to start a branch at revision 1.3,
invoke:
ci -r1.3.1 f.c
This command starts a branch numbered 1 at revision 1.3, and assigns the number 1.3.1.1 to the new revi-
sion. For more information about branches, see rcsfile(4).
RCS File Naming and Location
RCS recognizes two kinds of files: RCS files (revision archives), and working files. Working file names are
defined by the RCS user, RCS file names are generated by RCS by appending ,v to the working file name.
Pairs of RCS files and working files can be specified in 3 ways:
• Both the RCS file and the working file are given. The RCS file name is of the form path1/workfile,v
and the working file name is of the form path2/workfile, where path1 and path2 are (possibly
HP-UX 11i Version 3: February 2007 − 2 − Hewlett-Packard Company 401