Hello Vault team! I am running client/server version 3.1.9.3798.
I have a tiny command line app that gets the files from vault with a specified version. I am trying to ensure, before trying to download the file, that the version really exists. Is there a command I can use for this? I tried using the endversion I saw on the online command list but I believe because of the version I am running that is not supported.
Thanks in advanced!
Vault check if version of a file (path) exists
Moderator: SourceGear
Re: Vault check if version of a file (path) exists
You could run a history query and give a version range there with the switches -beginversion and -endversion. If you tried the -endversion switch alone, try using it with -beginversion as well.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Vault check if version of a file (path) exists
I was in fact using this:
history -rowlimit 1 -beginversion 25 $/MYFILEPATH
So lets assume the latest version of MYFILEPATH is version 20, if I use the line above.. I do get a success result = YES and returns the info for version 20 (the latest version). I thought this would return an error but id doesn't. I also tried using -endversion but it seems it is not recognized:
<vault>
<error>
unknown option: -endversion - run 'vault.exe HELP' for help
</error>
<result success="no" />
</vault>
This is how I've tried to use it. Again latest version is 20. None of these seem to work correctly. I have turn ON the rememberlogin option prior running the command.
history -rowlimit 1 -endversion 30 $/MYFILEPATH
history -rowlimit 1 -beginversion 30 -endversion 30 $/MYFILEPATH
history -endversion 30 $/MYFILEPATH
Thanks for the help!
history -rowlimit 1 -beginversion 25 $/MYFILEPATH
So lets assume the latest version of MYFILEPATH is version 20, if I use the line above.. I do get a success result = YES and returns the info for version 20 (the latest version). I thought this would return an error but id doesn't. I also tried using -endversion but it seems it is not recognized:
<vault>
<error>
unknown option: -endversion - run 'vault.exe HELP' for help
</error>
<result success="no" />
</vault>
This is how I've tried to use it. Again latest version is 20. None of these seem to work correctly. I have turn ON the rememberlogin option prior running the command.
history -rowlimit 1 -endversion 30 $/MYFILEPATH
history -rowlimit 1 -beginversion 30 -endversion 30 $/MYFILEPATH
history -endversion 30 $/MYFILEPATH
Thanks for the help!
Re: Vault check if version of a file (path) exists
It appears -endversion didn't come into being until Vault 4.0.
You might have to perform a general history on an item and then parse the results and when you're at the version number see if it matches the version you want.
You might have to perform a general history on an item and then parse the results and when you're at the version number see if it matches the version you want.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Vault check if version of a file (path) exists
That is what I thought, just wanted to make sure my suspicions were correct. Thanks for the help.
Re: Vault check if version of a file (path) exists
You're welcome.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support