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: Larry Jones
Subject: Re: How to find the parent of any random branch
Date: Fri, 24 Aug 2001 13:20:06 -0400 (EDT)

address@hidden writes:
> 
> The "Sticky Tag" tells me the branch name - I'm looking
> for the parent of the branch.
> 
> Looks like the only way to do it is to
> do a cvs status -v and then try and parse the 
> output to find the branch point that has the same
> first three revision numbers.

Not quite.  An actual revision has an even number of components in it's
revision number, branches have an odd number of components.  If you
remove the last component from a revision, you get the branch that it's
part of (except that if there's only a single component left, it's on
the trunk, reguardless of the actual value of the number).  If you
remove the last two components, you get the revision that it's based on.
If you remove the last three components, you get the branch that it's
based on.

So, for your examples:

>    Sticky Tag:          devsdk1 (branch: 1.66.8)

The parent of this branch is the trunk (1).

>    Sticky Tag:          rel2_final (branch: 1.66.6.1.2)

The parent of this branch is 1.66.6.

If you had a sticky tag of (branch: 1.2.3.4.5.6.7.8.9), it's parent
would be 1.2.3.4.5.6.7.

-Larry Jones

I've got more brains than I know what to do with. -- Calvin



reply via email to

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