[comp.unix.questions] RCS co/ci commands problem.

scott@boake2.UUCP (Scott Boake) (05/06/89)

I've been in the process of installing RCS on a machine here but I'm having
a little problem with the ci / co commands.

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.

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.

Hummmmm.... I cannot find a switch or command line option anywhere to fix
this problem (?).

Comments ?  Suggestions ?

HELP!

----Scott


Scott Boake                                       Small Systems Consulting
scott@boake2                                      P.O. Box 2142
..!uunet!pdn!boake2!scott                         5030 - 78th Ave North Ste. 10
+1 (813) 544 - 8152                               Pinellas Park, FL 34664

hitz@auspex.auspex.com (Dave Hitz) (05/07/89)

In article <264@boake2.UUCP> scott@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

runyan@hpirs.HP.COM (Mark Runyan) (05/10/89)

>/ scott@boake2.UUCP (Scott Boake) /  7:13 pm  May  5, 1989 /
>
>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.
>
>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.

I suppose by this you are requesting that RCS should follow the top branch
out to the end of the branch.  I don't think you'll find an RCS that will
do that  (you may, I just don't know of one).

A possible solution is to use symbolic names and specify the revision you
want to check out.  For instance, you might call branch 1.1.1 release_1,
allowing you to use the command "co -rrelease_1 foo".  If you use this
symbolic name on all the files in the group, you may find it easier to
work with a group of files needed for "release_1" of the code.

Mark Runyan

exodus@cheers.UUCP (Greg Onufer) (05/10/89)

In article <1577@auspex.auspex.com>, hitz@auspex.auspex.com (Dave Hitz) writes:
> 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'

Or, if you'd like, _everybody_ using the RCS file can have this as a default
by using an administrative option:

	rcs -b1.1.1 RCSfile

which makes the 1.1.1 branch the default for the file `RCSfile'.  It has its
uses...

greg

chris@mimsy.UUCP (Chris Torek) (05/10/89)

In article <237@cheers.UUCP>, exodus@cheers.UUCP (Greg Onufer) writes:
-	rcs -b1.1.1 RCSfile
-
-... makes the 1.1.1 branch the default for the file `RCSfile'.  It has its
-uses...

Alas, this exists only in RCS 4.0 (and later).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris