How to return current branch info in ClearCase

Mark Owens's picture
Mark Owens asked on December 10, 2010 - 1:56pm | Replies (3).

I need to be able to isolate the branch upon which a given version of an element resides from within a script.

Is there a desc or ls command or something that will take a -fmt argument that will give me the branch?

3 Answers

Marc Girod's picture
Marc Girod replied on December 10, 2010 - 4:36pm.

-fmt %n, out of which you remove the version number.

Marc

Garry Short's picture

If you're trying to do this in a trigger, there's also a couple of environment variables you can use:

CLEARCASE_XPN
CLEARCASE_BRTYPE

These can be found by searching the manpage for mktrtype.

You can also use 'em in Perl with the %ENV hash:

my $extended_path = $ENV{"CLEARCASE_XPN"};

HTH,

Garry

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.