Getting a label with "labelpath" in the Command Line Client

A collection of information about Vault, including solutions to common problems.

Moderator: SourceGear

Post Reply
lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Getting a label with "labelpath" in the Command Line Client

Post by lbauer » Mon May 16, 2011 5:28 pm

When you Getlabel in the Command Line Client there are certain situations where you may need to use "labelpath" in your command.

Code: Select all

Getlabel usage: vault.exe GETLABEL [options] repositorypath label [labelpath]
If you label a folder that has subfolders with shared files, the Command Line Client may not know which shared file to retrieve. You need to provide the path to the item you wish to Get by label.

For instance, if File.cs is shared between Subfolder A and Subfolder B under FolderA, this command would fail with a "FailInvalidLabel" error:

Code: Select all

vault GETLABEL -host myserver -user user -password mypassword  -repository Myrepository $/MyProject/FolderA/SubfolderB/Somefolder/File.cs  MyLabel -labelworkingfolder C:\Workingfolder
You need to use "labelpath."

"Labelpath" should be the path starting at the folder where the label was applied, (not at $/ unless the label was applied at root). So if the label was applied at FolderA, the labelpath would be "FolderA/SubfolderB/Somefolder/File.cs MyLabel." This command should succeed:

Code: Select all

vault GETLABEL -host myserver -user user -password mypassword  -repository Myrepository getlabel $/MyProject/FolderA/SubfolderB/Somefolder/File.cs MyLabel -labelworkingfolder C:\Workingfolder labelpath FolderA/SubfolderB/Somefolder/Files.cs
If, in a similar shared file scenario, the label had been applied at SubfolderB, the "labelpath" would be "SubfolderB/Somefolder/Files.cs"
Linda Bauer
SourceGear
Technical Support Manager

Post Reply