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?
Unable to get latest from vault command line windows
Moderator: SourceGear
Re: Unable to get latest from vault command line windows
I don't see your repository path in your command. Is that possibly missing?
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Unable to get latest from vault command line windows
Hi Beth,Beth wrote:I don't see your repository path in your command. Is that possibly missing?
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?
Re: Unable to get latest from vault command line windows
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.
"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
SourceGear Technical Support
Re: Unable to get latest from vault command line windows
Thanks a lot Beth. It worked!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.
Re: Unable to get latest from vault command line windows
Thanks for the update. Always happy to hear good news.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support