Kindly Vault People,
I'm trying to write a nAnt task which generates some differential information based on two different labels. I can get the label information without any trouble using the GetByLabel_GetStructure call and iterating over the folder that comes back. I call this twice, on the first (older) label and then the last (newer) one.
I run into trouble when I try to get files from one of the labels (the older one). I tried calling:
ClientInstance.GetLabeledFileToNonWorkingFolder(vcfile, startLabel, null, ref outpath);
Where "vcfile" is the VaultClientFile pulled from the results of the first call to GetByLabel_GetStructure. I keep getting an "invalid path" error when I make the GetLabeledFileToNonWorkingFolder call.
However, if I re-get the VaultClientInfo from the tree cache, it works:
VaultClientFile refile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(vcfile.ID);
refile.ObjVerID = 0;
refile.Version = oldVersion;
GetLabeledFileToNonWorkingFolder likes "refile", but not "vcfile". Why? I'm wary of performing this extra step if it's not necessary.
Also, since I have a list of VaultClientFiles, with the correct versions set, is there any way I can call ClientInstance.GetByDisplayVersionToNonWorkingFolder with a file array? I tried this, but had trouble getting the call to work.
I guessing that something here is in the wrong state, but I don't know what the right steps are to get it back in order.
VaultLib API - Get files by label
Moderator: SourceGear
ItemPath
Do you mean the vcfile.FullPath? They are indeed different. vcfile's path is relative to the label root (project/file.cs), whereas the refile path contains the full path ($/department/project/file.cs).
So this means that I have to call FindFileRecursive in order to get a VaultClientFile which has a correct path? That seems doable, except in the case where a file has been deleted after the project was labeled. In that case, when I call ClientInstance.Respository.Root.FindFileRecursive I get a null back.
How do you retrieve the labeled version?
So this means that I have to call FindFileRecursive in order to get a VaultClientFile which has a correct path? That seems doable, except in the case where a file has been deleted after the project was labeled. In that case, when I call ClientInstance.Respository.Root.FindFileRecursive I get a null back.
How do you retrieve the labeled version?
I mis-spoke. I don't think you need the repository's path, but the label's path.
The best bet is to take a look at the Vault Command Line source code in the Vault CLC API. Check out the VaultCmdLineClient::ProcessCommandGetLabel() method as it has the steps used in retrieving a label's file info.
HTH
The best bet is to take a look at the Vault Command Line source code in the Vault CLC API. Check out the VaultCmdLineClient::ProcessCommandGetLabel() method as it has the steps used in retrieving a label's file info.
HTH
Jeff Clausius
SourceGear
SourceGear