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: chrossi
Subject: Re: How to find the parent of any random branch
Date: Fri, 24 Aug 2001 09:47:00 -0700
User-agent: Mutt/1.2.5i

On Fri, Aug 24, 2001 at 11:40:04AM -0400, Larry Jones wrote:
> Charles V. Rossi writes:
> > 
> > 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.
> 
> No it isn't, it's trivial: the "Sticky Tag" tells you what branch, if
> any, you checked out.  (If you use status -v, you can even find the
> branch tag for the branch easily.)
> 

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.

If there are only three revision numbers in "Sticky", you know it was branched
from HEAD:

===================================================================
File: Makefile          Status: Up-to-date

   Working revision:    1.66.8.2
   Repository revision: 1.66.8.2        /build/cvs/bora/Makefile,v
   Sticky Tag:          devsdk1 (branch: 1.66.8)



If there are more than three, you'd have to find the branch point
that starts with the first three (in this case, 1.66.6).

===================================================================
File: Makefile          Status: Up-to-date

   Working revision:    1.66.6.1.2.1
   Repository revision: 1.66.6.1.2.1    /build/cvs/bora/Makefile,v
   Sticky Tag:          rel2_final (branch: 1.66.6.1.2)


I'm sure it gets weirder for deeper branches.  Anyway, it just
seems tricky to do it programmatically.

chuckr




reply via email to

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