info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pvcs to cvs and magic branches


From: Greg A. Woods
Subject: Re: pvcs to cvs and magic branches
Date: Fri, 13 Jul 2001 15:26:07 -0400 (EDT)

[ On Friday, July 13, 2001 at 13:36:39 (-0400), Eric Siegerman wrote: ]
> Subject: Re: pvcs to cvs and magic branches
>
> But then, why expend all this extra effort to do something
> counter to CVS's documented design, just because you ought to be
> able to get away with it?  The conversion script already makes
> sure the branch numbers are even; why not just go with the flow?

That's a good question.  I don't know the full answer.

Perhaps it's best to endeavour to translate branches into CVS magic
branches because any legacy support for RCS branches is more likely to
be broken in future versions....

Here's some further explanation of how CVS chooses magic branch numbers,
from the code:

/*
 * Return a "magic" revision as a virtual branch off of REV for the RCS file.
 * A "magic" revision is one which is unique in the RCS file.  By unique, I
 * mean we return a revision which:
 *      - has a branch of 0 (see rcs.h RCS_MAGIC_BRANCH)
 *      - has a revision component which is not an existing branch off REV
 *      - has a revision component which is not an existing magic revision
 *      - is an even-numbered revision, to avoid conflicts with vendor branches
 * The first point is what makes it "magic".
 *
 * As an example, if we pass in 1.37 as REV, we will look for an existing
 * branch called 1.37.2.  If it did not exist, we would look for an
 * existing symbolic tag with a numeric part equal to 1.37.0.2.  If that
 * didn't exist, then we know that the 1.37.2 branch can be reserved by
 * creating a symbolic tag with 1.37.0.2 as the numeric part.
 *
 * This allows us to fork development with very little overhead -- just a
 * symbolic tag is used in the RCS file.  When a commit is done, a physical
 * branch is dynamically created to hold the new revision.
 *
 * Note: We assume that REV is an RCS revision and not a branch number.
 */

Note that a "magic" branch revision has a branch number of ".0." in it,
and it's not just something ending in an even number.  If I remember
correctly the even number is just to avoid confusion with a vendor
branch number (i.e. ".1").

Unfortunately the above explanation doesn't talk about how CVS notices
exiting physical RCS branches and makes use of them....  It looks from
other code and comments though like CVS uses the normal RCS logic for
finding RCS branches (numdots & 1), i.e. an odd number of dots.

-- 
                                                        Greg A. Woods

+1 416 218-0098      VE3TCP      <address@hidden>     <address@hidden>
Planix, Inc. <address@hidden>;   Secrets of the Weird <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]