RCS co/ci commands problem.

Dave Hitz hitz at auspex.auspex.com
Sun May 7 03:58:51 AEST 1989


In article <264 at boake2.UUCP> scott at boake2.UUCP (Scott Boake) writes:
> If I create a file 'foo' and do a 'ci' command, it creates 'foo,v' branch 1.1.
> Now when I do a 'co foo', I have branch 1.1.  All is ok so far.
>
> Make changes to foo and do a 'ci -r1.1.1 foo'  No errors and a branch 1.1.1.1
> is now in the foo,v file.  I would prefer 1.1.1 but can live with the 1.1.1.1.

With RCS, all revision names have an even number of digits:

	o The first two digits describe a revision on the main branch
	  or "trunk" of the RCS tree.  (A single digit would suffice,
	  but two can be convenient when interpreted as major rev,
	  minor rev.)

	o Each 2 digit pair after the first identifies a branch and 
	  a revision on the branch.

Some examples.  

	o 2.3 is a revision on the trunk.

	o 2.3.1.1 is the first revision on the first branch off of 2.3.

	o 2.3.1.2 is the second revision on the first branch off of 2.3.

	o 2.3.2.1 is the first revision on the second branch off of 2.3.

	o 2.3.2.1.3.2 is the second revision on the third branch off of 2.3.2.1.

With just a three digit number, you wouldn't be able to put a second
branch onto 2.3.  Note that these numbers can get arbitrarily long, but
that they always contain enough information to identify a revision's
position exactly within the RCS tree.  (This is an improvement over
SCCS branches which are always 4 digits long and which do not contain
enough information to uniquely specify the position of a revision in
the tree.)

It should be apparent that one can easily confuse oneself with branches.

> Everything is just as I expected up to here.
>
> At this time I do a 'co foo' thinking I will get branch 1.1.1.1 - surprise!
> I have branch 1.1.

In RCS, the default version to work with is always the head (highest
numbered revision) on the trunk.

If you want a different revision, you must specify it explicitly by
revision number:

	co -r1.1.1.1 foo

Instead of specifying a revision, you can specify a branch and rcs will
get the head of that branch:

	co -r1.1.1 foo

This should help explain why "ci -r1.1.1 foo" created revision "1.1.1.1"
The command meant "check foo in as the head of the 1.1.1 branch".  Since
There were no revisions already on the branch, yours became the first.

If you are doing lots of work on a particular branch, you might try
the following aliases:

	alias co 'co -r1.1.1'
	alias ci 'ci -r1.1.1'

-- 
Dave Hitz					home: 408-739-7116
UUCP: {uunet,mips,sun,bridge2}!auspex!hitz 	play: 408-970-8970



More information about the Comp.unix.questions mailing list