Discussion:
matching a tag to a branch
Jim Perrier
2012-02-17 19:45:11 UTC
Permalink
I was wondering if anyone could tell me how to match a tag to a branch?
I've inherited this working environment, so understand that I didn't
design the tagging naming system.
What I'm trying to do is create a shell script that I could supply the
build tag "DSC_4_0_I675" and
have it return the branch it belongs to.

*DSC_4_0_I420 belongs to DSC40*
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I420
T 2011-11-02 05:29 +0000 nmsbuilder tpapps [DSC_4_0_I420:DSC40]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I669
T 2011-10-27 07:43 +0000 nmsbuilder tpapps [DSC_4_0_I669:A]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I675
T 2011-11-02 16:23 +0000 nmsbuilder tpapps [DSC_4_0_I675:A]
T 2011-11-02 19:31 +0000 nmsbuilder tpapps [DSC40MAIN:DSC_4_0_I675]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I681
T 2011-11-08 06:31 +0000 nmsbuilder tpapps [DSC_4_0_I681:DSC40MAIN]

I'm not sure what "A" stands for? HEAD maybe? I know DSC40MAIN was
created from the HEAD
It's also awkward when the reply returns the branch name before and
sometimes after the tag.

I'd appreciate any help you could give me.
Arthur Barrett
2012-02-20 03:59:28 UTC
Permalink
Hi Jim,

Which version of CVS are you using?

1. Don't use 'cvs history' - this relies on a very simple logging
mechanism. A) it's ot failsafe (ie: the server can record changes, but
not history log them; and B) until very very recent releases if the log
file was in use (potentially common on busy servers) the logging was
simply skipped.

2. Get the version number for the tag (using 'cvs rlog) eg:
1.106.2.210.6.99.2.49, and then you can calculate the branch name (ie:
1.106.2.210.6.99.0.2).

3. You can see this (which branch a tag is on) visually using something
like the 'revision graph' feature of TortoiseCVS

But the better question is why? Why do you need to find the branch name
from the tag name? CVS has been around and in use for almost 30 years -
anything you want to do has already been done a million times (sorry, we
all want to think our organization and our process is unique, but
c'mon). Don't reinvent the wheel.

Note: if you are using CVS 2.x or CVSNT, then I recommend you contact
the vendor (March Hare Software) for support/training, CVSNT is NoT CVS.
Most windows tools use (and work best with) CVSNT, eg: TortoiseCVS...

Regards,


Arthur
-----Original Message-----
org] On Behalf Of Jim Perrier
Sent: Saturday, 18 February 2012 6:45 AM
Subject: matching a tag to a branch
I was wondering if anyone could tell me how to match a tag to
a branch?
I've inherited this working environment, so understand that I didn't
design the tagging naming system.
What I'm trying to do is create a shell script that I could
supply the
build tag "DSC_4_0_I675" and
have it return the branch it belongs to.
*DSC_4_0_I420 belongs to DSC40*
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I420
T 2011-11-02 05:29 +0000 nmsbuilder tpapps [DSC_4_0_I420:DSC40]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I669
T 2011-10-27 07:43 +0000 nmsbuilder tpapps [DSC_4_0_I669:A]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I675
T 2011-11-02 16:23 +0000 nmsbuilder tpapps [DSC_4_0_I675:A]
T 2011-11-02 19:31 +0000 nmsbuilder tpapps
[DSC40MAIN:DSC_4_0_I675]
cvs history -a -T | grep -w tpapps | grep DSC_4_0_I681
T 2011-11-08 06:31 +0000 nmsbuilder tpapps
[DSC_4_0_I681:DSC40MAIN]
I'm not sure what "A" stands for? HEAD maybe? I know DSC40MAIN was
created from the HEAD
It's also awkward when the reply returns the branch name before and
sometimes after the tag.
I'd appreciate any help you could give me.
Arthur Barrett
2012-02-23 00:29:32 UTC
Permalink
Hi Jim,

Please send questions to the group, not direct to me.

My idea was not so much to use a GUI tool, as in use the code that the
GUI tool uses. The point of open source software is to reuse the
code...

I tested this on CVSNT 2.8:

cvs log -hr:ABC_1_0_I333

If you search the output for revisions with a zero as the second last
character, you'll get the branches that ABC_1_0_I333 is on.

Regards,


Arthur
Jim Perrier
2012-02-29 13:10:31 UTC
Permalink
Sorry about the direct reply. You're right about the zero as the second
character. The only problem is that it returns all the branches, not
just the one ABC_1_0_I333 was created on. My search for the correct
wheel continues.

\Jim
Post by Arthur Barrett
Hi Jim,
Please send questions to the group, not direct to me.
My idea was not so much to use a GUI tool, as in use the code that the
GUI tool uses. The point of open source software is to reuse the code...
cvs log -hr:ABC_1_0_I333
If you search the output for revisions with a zero as the second last
character, you'll get the branches that ABC_1_0_I333 is on.
Regards,
Arthur
Arthur Barrett
2012-03-02 12:09:04 UTC
Permalink
Jim,

If you use the command I sent, you should just see the branch(es) that
tag is on.

Regards,


Arthur
-----Original Message-----
org] On Behalf Of Jim Perrier
Sent: Thursday, 1 March 2012 12:11 AM
To: cvs-user-list
Subject: Re: matching a tag to a branch
Sorry about the direct reply. You're right about the zero as
the second
character. The only problem is that it returns all the branches, not
just the one ABC_1_0_I333 was created on. My search for the correct
wheel continues.
\Jim
Post by Arthur Barrett
Hi Jim,
Please send questions to the group, not direct to me.
My idea was not so much to use a GUI tool, as in use the
code that the
Post by Arthur Barrett
GUI tool uses. The point of open source software is to
reuse the code...
Post by Arthur Barrett
cvs log -hr:ABC_1_0_I333
If you search the output for revisions with a zero as the
second last
Post by Arthur Barrett
character, you'll get the branches that ABC_1_0_I333 is on.
Regards,
Arthur
Jim Perrier
2012-03-02 12:37:00 UTC
Permalink
Here is a sample of what's returned. I've cut out many of the entries
between "revisions with a zero as the second last character". The tag
was actually applied against DSC_5_0_R1.

cvs log -hr:DSC_5_0_I112 | more
cvs log: Logging tpapps

RCS file: /swdev/tagcvs/tpapps/.IBUILD,v
Working file: tpapps/.IBUILD
head: 1.771
branch:
locks: strict
access list:
symbolic names:
DSC_4_0_I834: 1.649.2.68
DSC50LINUX: 1.739.0.2
DSC_5_0_I80: 1.739
DSC_4_0_I717: 1.649.2.33.2.9
DSC50SANDBOX: 1.699.0.2
DSC_5_0_I40: 1.699
DSC_4_0_I800: 1.649.2.34
DSC40R3: 1.649.2.33.0.2
DSC_5_0_I36: 1.695
DSC_4_0_R1-00: 1.623.2.17.2.1
DSC40R1: 1.623.2.17.0.2
DSC_4_0_I666: 1.640
etc...
Post by Arthur Barrett
Jim,
If you use the command I sent, you should just see the branch(es) that
tag is on.
Regards,
Arthur
-----Original Message-----
org] On Behalf Of Jim Perrier
Sent: Thursday, 1 March 2012 12:11 AM
To: cvs-user-list
Subject: Re: matching a tag to a branch
Sorry about the direct reply. You're right about the zero as
the second
character. The only problem is that it returns all the branches, not
just the one ABC_1_0_I333 was created on. My search for the correct
wheel continues.
\Jim
Post by Arthur Barrett
Hi Jim,
Please send questions to the group, not direct to me.
My idea was not so much to use a GUI tool, as in use the
code that the
Post by Arthur Barrett
GUI tool uses. The point of open source software is to
reuse the code...
Post by Arthur Barrett
cvs log -hr:ABC_1_0_I333
If you search the output for revisions with a zero as the
second last
Post by Arthur Barrett
character, you'll get the branches that ABC_1_0_I333 is on.
Regards,
Arthur
Arthur Barrett
2012-03-04 06:48:19 UTC
Permalink
Jim,

Sorry - you misunderstand me I think.

The manual says that -r should work. If you are saying it's not
working, then it's open source and you can fix it. Or find a more
recent release where it is working.

Note: it's the server that generates tohe log, not the client, so the
server code is what is important here.

If it's not working in CVSNT 2.8 (yes it runs on linux servers, and hpux
servers and...) then you should report it to the technical support team
and they can get it fixed, but I've already tested CVSNT and it works
(at least in my case).

Regards,


Arthur


-----Original Message-----
From: Jim Perrier [mailto:***@alcatel-lucent.com]
Sent: Friday, 2 March 2012 11:37 PM
To: Arthur Barrett
Cc: cvs-user-list
Subject: Re: matching a tag to a branch


Here is a sample of what's returned. I've cut out many of the
entries between " revisions with a zero as the second last character".
The tag was actually applied against DSC_5_0_R1.

cvs log -hr:DSC_5_0_I112 | more
cvs log: Logging tpapps

RCS file: /swdev/tagcvs/tpapps/.IBUILD,v
Working file: tpapps/.IBUILD
head: 1.771
branch:
locks: strict
access list:
symbolic names:
DSC_4_0_I834: 1.649.2.68
DSC50LINUX: 1.739.0.2
DSC_5_0_I80: 1.739
DSC_4_0_I717: 1.649.2.33.2.9
DSC50SANDBOX: 1.699.0.2
DSC_5_0_I40: 1.699
DSC_4_0_I800: 1.649.2.34
DSC40R3: 1.649.2.33.0.2
DSC_5_0_I36: 1.695
DSC_4_0_R1-00: 1.623.2.17.2.1
DSC40R1: 1.623.2.17.0.2
DSC_4_0_I666: 1.640
etc...

On 3/2/2012 7:09 AM, Arthur Barrett wrote:

Jim,

If you use the command I sent, you should just see the
branch(es) that
tag is on.

Regards,


Arthur



-----Original Message-----
From:

info-cvs-bounces+arthur.barrett=march-***@nongnu.org

[mailto:info-cvs-bounces+arthur.barrett=march-***@nongnu.
org] On Behalf Of Jim Perrier
Sent: Thursday, 1 March 2012 12:11 AM
To: cvs-user-list
Subject: Re: matching a tag to a branch


Sorry about the direct reply. You're right about
the zero as
the second
character. The only problem is that it returns
all the branches, not
just the one ABC_1_0_I333 was created on. My
search for the correct
wheel continues.

\Jim



On 2/22/2012 7:29 PM, Arthur Barrett wrote:

Hi Jim,
Please send questions to the group, not
direct to me.
My idea was not so much to use a GUI
tool, as in use the

code that the

GUI tool uses. The point of open source
software is to

reuse the code...

I tested this on CVSNT 2.8:
cvs log -hr:ABC_1_0_I333
If you search the output for revisions
with a zero as the

second last

character, you'll get the branches that
ABC_1_0_I333 is on.
Regards,
Arthur

Loading...