info-cvs
[Top][All Lists]
Advanced

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

Re: How to find the parent of any random branch


From: Stephen Cameron
Subject: Re: How to find the parent of any random branch
Date: Fri, 24 Aug 2001 13:02:23 -0700 (PDT)

Charles V. Rossi (address@hidden) wrote:
 
> If I'm sitting in a checked out branch how can I find
> who I was branched from (HEAD vs. some other branch)?
>
> I might be able to figure it out from 'cvs status <file>',
> but it's painful.

There is not any way to do this in all cases.

The same revision of a file may be present on several branches,
Imagine you make 3 new branches all in a row.  Initially, they
all contain the same revisions of every file.  (Only when you
commit a file to a branch will it have a different revision number
for that file.)

Suppose you have foo.txt at revision 1.2 and you make 3 branch tags:
cvs tag -b branch1 foo
cvs tag -b branch2 foo
cvs tag -b branch3 foo
Then 
cvs update -r branch3 foo
cvs tag -b branch4 foo

Conceptually, and for practical purposes, "branch3" is the "parent" 
of "branch4".  However, since no changes were made to foo in any of
these branches we have:

address@hidden xx]$ cvs log -h foo

RCS file: /home/scameron/cvstestbr/xx/foo,v
Working file: foo
head: 1.2
branch:
locks: strict
access list:
symbolic names:
        branch3: 1.2.0.6
        branch2: 1.2.0.4
        branch1: 1.2.0.2
keyword substitution: kv
total revisions: 2
=============================================================================

Notice that those revisions are all "magic" revisions 
(notice the zero) that don't exist separately, but all 
refer to "1.2"

address@hidden xx]$ cvs update -r branch3 foo
address@hidden xx]$ cvs tag -b branch4
cvs tag: Tagging .
T foo
address@hidden xx]$ cvs log -h foo

RCS file: /home/scameron/cvstestbr/xx/foo,v
Working file: foo
head: 1.2
branch:
locks: strict
access list:
symbolic names:
        branch4: 1.2.0.8
        branch3: 1.2.0.6
        branch2: 1.2.0.4
        branch1: 1.2.0.2
keyword substitution: kv
total revisions: 2
=============================================================================
address@hidden xx]

So, you can't tell by looking that branch4 was created from
checking out branch3 and tagging it, you just have to "know" 
that. (means you should write down the relationship between 
branches someplace)

Also, it is not necessary that a branch tag have any single
parent branch.  The "parent" might be a tagging of a conglomeration
of different branches and the trunk, if you so desired.

-- steve

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



reply via email to

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