I have a method that iterates through a repository tree structure and creates a VaultClientFileColl of all the objects I want to share (and eventually pin) in a versioned tree structure in the same repository.
ex: share $/Project/A/foo.c to $/Versions/Project_1.2.3.4/A/foo.c
The idea is to merely loop through the File collection and create a target path by replacing $/Project with $/Versions/Project_1.2.3.4.
At first, I read the documentation, and it says that the target folder must exist, so I modified my code to do this. Everything OK so far. However, it still fails on the on ProcessCommand with the following exception:
No object was found at the repository path: $/Versions/Simulator_1.1.1.10/SimLogWindow/SimLogWindow.csproj
Here's the exact code:Note:
SourcePath = $/SimulatorTip/SimLogWindow/SimLogWindow.csproj <Confirmed that this exists>
TargetPath = "$/Versions/Simulator_1.1.1.10/SimLogWindow/SimLogWindow.csproj"
RepoPath $/Versions/Simulator_1.1.1.10/SimLogWindow <as pasted from client to make sure no typo>
I can get this call to work on a folder, but not a file. I can do this manually, but not with the API currently...
I attached a png of our Vault Client so you can see the source / target exist
foreach (VaultClientFile file in files)
{
string SourcePath = file.FullPath ;
string TargetPath = SourcePath.Replace(Source,Target);
ServerOperations.ProcessCommandShare(SourcePath,TargetPath); //exception thrown here
ServerOperations.ProcessCommandPin(TargetPath,-1);
}
ProcessCommandShare Difficulties
Moderator: SourceGear
ProcessCommandShare Difficulties
- Attachments
-
- Picture of Client showing tree layout
- VaultShareAPI.png (8.78 KiB) Viewed 5749 times
Re: ProcessCommandShare Difficulties
ProcessCommandShare expects the target to be a folder.
So in your case, it looks like the code should be:
Think of it as "Share into", not "Share as".
So in your case, it looks like the code should be:
Code: Select all
// assuming Target contains $/Versions/Simulator_1.1.1.10/SimLogWindow/
string SourcePath = file.FullPath ;
string TargetPath = SourcePath.Replace(Source,Target);
ServerOperations.ProcessCommandShare(SourcePath,Target);
ServerOperations.ProcessCommandPin(TargetPath,-1);
Paul Roub
SourceGear
SourceGear