GETLABEL command line

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

Moderator: SourceGear

Post Reply
MikeSp
Posts: 2
Joined: Mon Nov 04, 2013 12:24 pm

GETLABEL command line

Post by MikeSp » Mon Nov 04, 2013 12:37 pm

Hello,

I'm trying to automate our builds and having some trouble. We have 1 repository with many projects and some files shared between them. When the developer is working I want to create a script that labels a version and creates a separate build non working folder to make sure it is compiled with only the label contents.

I want the script generic so it doesn't need to be adjusted for every project (we have many small projects).

btw It was not labeled on the root, but a sub folder.

vault.exe getlabel -host xxx -user "xxx" -password "xxx" -repository "xreposx" $/ -nonworkingfolder "C:\test" "MyLabel"

I was hoping this would get and build a folder structure in c:\test with the relevant labels, and this fails.

Is there any way from the working folder locally that I can say get the label associated with this working folder, or through command line get the repository path from the working folder?

<vault>
<error>
<exception>System.Exception: Could not find label "mylabel" created at item "$". The server did not return a repository delta or file delta for item $ at VaultClientIntegrationLib.GetOperations.performLabelGet(String objectPath, String label, String labelSubItem, String labelWorkingFolder, String destPath, GetOptions go) at VaultClientIntegrationLib.GetOperations.ProcessCommandGetLabelToLocationOutsideWorkingFolder(StringobjectPath, String label,String labelSubItem, GetOptions getOptions, String destPath) at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg) at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception>
</error>
<result>
<success>False</success>
</result>
</vault>

Thank you!
Mike

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

Re: GETLABEL command line

Post by Beth » Mon Nov 04, 2013 4:58 pm

What path was the label "MyLabel" created at? Rather than using $, try using the exact path the label was created at.
Beth Kieler
SourceGear Technical Support

MikeSp
Posts: 2
Joined: Mon Nov 04, 2013 12:24 pm

Re: GETLABEL command line

Post by MikeSp » Mon Nov 04, 2013 7:22 pm

You are right that does work, but I face two problems.

I don't always know the project because I want it to be generic, meaning this bat will be checked into multiple folders. It has to determine the archive path in vault from somewhere (working folder?) so it can label and retrieve labels.

If it is a recursive label how do I know what the "top" level is. I want to pull the full label and if I target a sub folder it is an inherited label and wont get all of it.

I'm open for suggestions as my end goal is to have a generic bat file that labels everything current and then pulls the label contents into a "build" folder. As a software process how do you guarantee the developers create their build from a label? It seems we have an issue putting releases together from the tips and not from a label, and shared code can get updated without them being aware.

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

Re: GETLABEL command line

Post by Beth » Wed Nov 06, 2013 4:23 pm

You could make your script generic by using a variable, and then pass in the path when you call it.

Another option would be to just apply your labels at $. This will have the effect of getting everything at root for that label though, so you wouldn't be able to get just one folder.
Beth Kieler
SourceGear Technical Support

Post Reply