Hello,
I am having trouble using the command line GETVERSION command. Specifically, specifying the version seems to go wrong.
If I use a command like this:
vault getversion -host <host> -user admin
-password <password> -repository <repository_name> 1 <file path> C:\temp
I get an error like this:
<vault>
<!-- Get latest version failed for <file path>: Invalid revision number. -->
<error>
Exception of type VaultClientOperationsLib.GetLatestVersionFailedException was t
hrown.
</error>
<exception>
VaultClientOperationsLib.GetLatestVersionFailedException: Exception of type Vaul
tClientOperationsLib.GetLatestVersionFailedException was thrown.
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo
[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType
merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, Str
ing ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String cur
rentPathToLabelItem, Int64 labelID, Boolean isRetry, Boolean isGetByDisplayVersi
on)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFol
der(VaultClientFile[] files, MakeWritableType makeWritable, SetFileTimeType setF
ileTime, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt Promp
tData)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFol
der(VaultClientFile file, MakeWritableType makeWritable, SetFileTimeType setFile
Time, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt PromptDa
ta)
at VaultCmdLineClient.VaultCmdLineClient.performGetVersion(VaultClientTreeObj
ect treeObjectToRetrieve, Int32 version, Boolean useWorkingFolder, MergeType mt,
String strDestFolder)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandGetVersion(Int32 versi
on, String strReposItem, String strDestFolder)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>
The problem seems to be that the version number (revision number) is wrong. But is is a version number that is returned by the HISTORY command. I can use the GUI client to get that same version (1). So what is wrong here?
Maybe someone has an example of a working GETVERSION command? I could not find an example anywhere..
Regards,
Frans
How to get GETVERSION to work?
Moderator: SourceGear
Here's a sample one I ran with success:
C:\Program Files\SourceGear\Vault Client>vault.exe getversion -host localhost -user xxxxx -password xxxxxx -repository textonly 1 $/B1/Folder13 -useworkingfolder "c:/Get"
I added in a location in the repository. Give something like this a try and let me know how it works for you. Also, check your server log for additional error information relation to your GetVersion.
C:\Program Files\SourceGear\Vault Client>vault.exe getversion -host localhost -user xxxxx -password xxxxxx -repository textonly 1 $/B1/Folder13 -useworkingfolder "c:/Get"
I added in a location in the repository. Give something like this a try and let me know how it works for you. Also, check your server log for additional error information relation to your GetVersion.
Thank you, it is nice to have an example. The difference seems to be that you use the -useworkingfolder option and have the local path where the file should be saved quoted.
But if I do the same I still get the same error ( Get latest version failed for $/xxx/xxxx : Invalid revision number. ). Which is a strange message because I did not request the latest version.
The log file on the server only shows me logging in and logging out when the command is executed. No error messages.
I think I will write to sourcegear support about this..
By the way, I use Vault 3.1.9
But if I do the same I still get the same error ( Get latest version failed for $/xxx/xxxx : Invalid revision number. ). Which is a strange message because I did not request the latest version.
The log file on the server only shows me logging in and logging out when the command is executed. No error messages.
I think I will write to sourcegear support about this..
By the way, I use Vault 3.1.9
What was discovered so far is that there's a difference between how the command line client and the GUI handle file history in a branch. The branched folder only has a history from the branch on forward, but the files have their history. In the GUI, you can get the file history from before the branch (but not the folder), but on the command line one can only retrieve the file history from the branch forward.
We have logged a bug on this so it can be reviewed and see if can be fixed for a future release.
We have logged a bug on this so it can be reviewed and see if can be fixed for a future release.