Unable to get latest from vault command line windows

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

Moderator: SourceGear

Post Reply
sushant
Posts: 13
Joined: Thu Oct 29, 2015 1:16 am

Unable to get latest from vault command line windows

Post by sushant » Mon Nov 30, 2015 9:01 am

Hi team,

I am automating some of my code fetch and compilation on my server.
I used the following GET command to fetch latest code from the vault but got the error.

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose

I get the following error:
<vault>
<error>usage: GET item [...]</error>
<result>
<success>False</success>
</result>
</vault>


1. I also used %ERRORLEVEL% in batch file to get the error code. It gets me -1 as error code.
2. To evade all of this, I tried setting working folder as well (Which succeeded) but GET failed again.

I used the -workingfolder flag explicitly just to ensure that it fetches latest code of that folder only from the repo.

Could you please guide me?

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

Re: Unable to get latest from vault command line windows

Post by Beth » Mon Nov 30, 2015 4:16 pm

I don't see your repository path in your command. Is that possibly missing?
Beth Kieler
SourceGear Technical Support

sushant
Posts: 13
Joined: Thu Oct 29, 2015 1:16 am

Re: Unable to get latest from vault command line windows

Post by sushant » Tue Dec 01, 2015 12:07 am

Beth wrote:I don't see your repository path in your command. Is that possibly missing?
Hi Beth,

My main motive is to get latest of one of the child folders from the repo.
E.g. My repo is built as following

$ > Folder1, Folder2, Folder3 (3 folders just beneath the root i.e. $)
$ > Folder1 > Folder1a, Folder1b, Folder1c (Folder 1 contains 3 sub folders here)
$ > Folder2 > Folder2a, Folder2b, Folder2c (Folder 2 contains 3 sub folders here)
$ > Folder3 > Folder3a, Folder3b, Folder3c (Folder 3 contains 3 sub folders here)

I need to get latest of, let's say, Folder1c on my disk.

I used the following command to explicitly set working folder on the root of my repo before running my actual GET command posted in the first question
So you could say my script looks something like the following compositely

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe SETWORKINGFOLDER -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -forcesubfolderstoinherit "$" "D:\Projects"

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose


Question1: I believe, the above SETWORKINGFOLDER command should be a one time procedure and shouldn't require execution each time in my script. Could you please confirm?

Now coming back to my GET command that I posted.
I used GET sample command present on your support website present here http://support.sourcegear.com/viewtopic ... 13&t=15235.

I'm unsure how to pitch in my repository path in the GET command. I thought that providing in the working folder like following shall pick up the path on its own.

-workingfolder "D:\Projects\Folder1\Folder1a" (I have modified this command just to suit the complete example)

Question2:Could you please guide me how to pitch in the exact path to the repository path and the appropriately mapped local disk folder in the GET command?

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

Re: Unable to get latest from vault command line windows

Post by Beth » Tue Dec 01, 2015 9:49 am

It's not the set working folder that's the issue. You need to just tell Vault if it should get $ or get $/Folder1/Folder1a.

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose $/Folder1/Folder1a

or

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose $

or skip the working folder since it's already set

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -makewritable -performdeletions removeworkingcopyifunmodified -verbose $

You need to tell it what part of the repository to actually Get. The working folder only tells it where to put it. Also, you don't have to keep specifying the working folder once it's set.
Beth Kieler
SourceGear Technical Support

sushant
Posts: 13
Joined: Thu Oct 29, 2015 1:16 am

Re: Unable to get latest from vault command line windows

Post by sushant » Wed Dec 02, 2015 2:55 am

Beth wrote:It's not the set working folder that's the issue. You need to just tell Vault if it should get $ or get $/Folder1/Folder1a.

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose $/Folder1/Folder1a

or

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -workingfolder "D:\Projects\Source\MyCodeProj\Trunk" -makewritable -performdeletions removeworkingcopyifunmodified -verbose $

or skip the working folder since it's already set

"C:\Program Files (x86)\SourceGear\Vault Client"\vault.exe GET -host xxxx.xxxx:8080 -user aaaa.bbbb -password abcdabcd -repository "My Repo" -merge automatic -setfiletime current -makewritable -performdeletions removeworkingcopyifunmodified -verbose $

You need to tell it what part of the repository to actually Get. The working folder only tells it where to put it. Also, you don't have to keep specifying the working folder once it's set.
Thanks a lot Beth. It worked! :)

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

Re: Unable to get latest from vault command line windows

Post by Beth » Wed Dec 02, 2015 11:05 am

Thanks for the update. Always happy to hear good news.
Beth Kieler
SourceGear Technical Support

Post Reply