Hi,
When I use the "Show history" function on a folder and select "View folder history by version", the resulting view will have a maximum (or latest) version number in the 1st line (top line).
I take this can be referred to as the "folder version".
I am looking for a way to get the "folder version" for a specified folder either via command-line or even better via Keyword expansion.
The reason is that I would like to use this number as a kind of build-number.
Today we work with a version number with a classical structure major.minor.release.build.
All 4 are updated manually - it would be great if the last of the 4 could be assigned automatically from vault, preferably by keyword expansion (I imagine something like $FolderVersion <foldername>$ or by command-line (we can then make a small script for this).
Best regards,
Hans Olav Nymand
Getting version number for a folder
Moderator: SourceGear
-
- Posts: 55
- Joined: Wed Sep 29, 2004 8:09 am
- Location: Denmark, Copenhagen
- Contact:
This is what we use to make our build number out of the transaction ID.
$vaultexe = $ENV{'VAULT_EXE'};
$vault = $ENV{'VAULT_TRUNK'};
$commandline = "\"$vaultexe\" versionhistory -rowlimit 1 -datesort desc -norecursive -excludeactions label -repository \"Default Repository\" $vault";
#Run the vault command and store results
$result = `$commandline`;
#Extract the value of the 'txid="*"' field
$result =~ /txid=\"(\d+)\"/;
$txid = $1;
#Extract the value of the 'version="*"' field
$result =~ /version=\"(\d+)\"/;
$folderversion = $1;
$vaultexe = $ENV{'VAULT_EXE'};
$vault = $ENV{'VAULT_TRUNK'};
$commandline = "\"$vaultexe\" versionhistory -rowlimit 1 -datesort desc -norecursive -excludeactions label -repository \"Default Repository\" $vault";
#Run the vault command and store results
$result = `$commandline`;
#Extract the value of the 'txid="*"' field
$result =~ /txid=\"(\d+)\"/;
$txid = $1;
#Extract the value of the 'version="*"' field
$result =~ /version=\"(\d+)\"/;
$folderversion = $1;