Vault check if version of a file (path) exists

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
jp1982
Posts: 28
Joined: Fri Aug 27, 2010 3:23 pm

Vault check if version of a file (path) exists

Post by jp1982 » Tue Jun 07, 2011 9:15 am

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!

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Vault check if version of a file (path) exists

Post by Beth » Tue Jun 07, 2011 1:23 pm

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

jp1982
Posts: 28
Joined: Fri Aug 27, 2010 3:23 pm

Re: Vault check if version of a file (path) exists

Post by jp1982 » Tue Jun 07, 2011 2:38 pm

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!

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Vault check if version of a file (path) exists

Post by Beth » Tue Jun 07, 2011 5:45 pm

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.
Beth Kieler
SourceGear Technical Support

jp1982
Posts: 28
Joined: Fri Aug 27, 2010 3:23 pm

Re: Vault check if version of a file (path) exists

Post by jp1982 » Thu Jun 09, 2011 11:46 am

That is what I thought, just wanted to make sure my suspicions were correct. Thanks for the help.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Vault check if version of a file (path) exists

Post by Beth » Thu Jun 09, 2011 12:38 pm

You're welcome.
Beth Kieler
SourceGear Technical Support

Post Reply