$ENV{'CLEARCASE_XPN'}
should give you the extended path name of the current version, as selected by the current view, not the "next" version.
Here "base" is for the current version before a CI trigger allows a new one to be created.
In that case, cleartool descr -l $ENV{'CLEARCASE_PN'} should still display the one selected by the current view foo.c@@/main/2
.
If not, using '-pred
' would help (to get the previous version): cleartool descr -pred -l $ENV{'CLEARCASE_PN'}
The OP coin confirms in the comments:
my $desc = 'cleartool descr $ENV{'CLEARCASE_PN'}';
if($desc =~ /predecessor version:\s*(.+)$/) {
die "Predecessor: $ENV{'CLEARCASE_PN'}\@\@$1";
}
"base" could be interpreted as the base contributor version for a merge (see "How to perform a 'merge' using clearcase?")
In that case, you can check:
cleartool findmerge -print
, which can list the names of the versions that require a merge. The default listing includes the version IDs of the to-versions and from-versions and the version ID of the base contributor (common ancestor)
cleartool describe -anc
, which is able to desribe the closest common ancestor version of all the pname arguments.