[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How do you work out "automatically" the set of branches and t he lat
RE: How do you work out "automatically" the set of branches and t he latest version of each branch within a CVS project ?
Tue, 23 Oct 2001 15:01:23 -0700
Just a few days ago, Matt, address@hidden, posted a snippet for
listing branches from the output of "cvs log -h"
Basically, you find tags listed that match ": <number>.<number>.0."
Once you know the branch tag, if you have the latest version of cvs, a
"cvs rlog -h -r TAGNAME module" will always report on the latest revision on
that branch. With pre 1.11.1p1 versions of cvs, you can
"cvs rdiff -s -r0 -rTAGNAME module" to get the latest revision number of
files on the branch. That output may be easier to parse anyway.
Yikes, I was just about to send this, and now I see that you don't want the
latest revision on each branch, you want the latest tag.
Well, in a way, that's impossible. The concept of the "latest tag," while it
usually makes sense in practice, doesn't make sense when you have tags
temporally intertwined. A tag that is before another tag on one file can be
after the same tag on another file.
I'm sure you can work out a way to do this, assuming the "latest tag" isn't
mixed up with other tags as I described above, but it's going to require
collecting a lot of data, and it's not going to be simple or pretty.
Some things to consider:
You could go through the "cvs log" output keeping track of the latest tagged
(meaning a tag other than the branch tag) revision on each branch.
One of the tags on each of these files is the last tag on the branch. If
there's more than one tag, it's going to be complicated.
> From: James Ball [mailto:address@hidden
> Sent: Tuesday, October 23, 2001 1:19 AM
> I need to work out the set of branches within a given project, and the
> latest "version" expressed by the latest TAG for each branch within a
> project. From what I've read there doesn't seem to be any obvious way
> to do this, which is puzzling given knowing what code you've got is
> normally a given, or at least essential.
> I'm not adverse to shell scripting. Any script snippets
> would be warmly
> received. We are running CVS on a Sun Sparc 4 paltform with the Korn
> and Bash shells.
> Basically, I need to find out what branches we've got and what the
> latest "version" of each branch happens to be, and I'm not
> sure where to
> start. I'm thinking of writing a shell script that
> interrogates either
> the base repository files direct or uses an elegant combination of cvs
> commands and their output. Again, any help will be greatly
> Please help as currently I'm a bit stumped for ideas.
> Jim Ball
> Info-cvs mailing list
- RE: How do you work out "automatically" the set of branches and t he latest version of each branch within a CVS project ?,
Jerry Nairn <=