Page 1 of 1
ProcessCommandBranch() producing .comparer branch dir
Posted: Mon May 14, 2012 12:56 pm
by nbuckle
When I use the API to branch a directory, I'd then like to label that branch... I'm attempting to accomplish this by doing the following
ServerOperations.ProcessCommandBranch(projectRepositoryPathWithCodeLine, targetBranchName);
VaultClientFolder vaultDirectory = ServerOperations.ProcessCommandListFolder(projectRepositoryPathWithCodeLine + targetBranchName, true);
var _branchVersionID = vaultDirectory.Version;
This makes sense to me but is failing because the branch I expect is not there.. when I step through code and get the branch directory I see a directory of theBranchIExpect + ".comparer"
How can I get around this issue
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Mon May 14, 2012 2:06 pm
by Beth
Are you getting the branch committed prior to the label?
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Mon May 14, 2012 2:19 pm
by nbuckle
When I perform the ServerLogin operations I set
ServerOperations.client.AutoCommit = true;
before I call my processcommandbranch()
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Mon May 14, 2012 3:13 pm
by nbuckle
what should I call post branch to ensure that I get a Commit.
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Mon May 14, 2012 3:17 pm
by Beth
In the code you posted is projectRepositoryPathWithCodeLine the same for both the command branch and list folder? You can't branch into the folder you're branching from.
Have you used the Vault GUI client to look and see if the branch was ever created?
Also, I'm not sure what you're doing with this line: var _branchVersionID = vaultDirectory.Version;. I'm assuming you have vaultDirectory.Version set somewhere else in the code?
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Tue May 15, 2012 9:28 am
by nbuckle
Let me clarify, I mistyped the code...
ServerOperations.ProcessCommandBranch(projectRepositoryPathTrunk, projectRepositoryPathBranch);
VaultClientFolder vaultDirectory = ServerOperations.ProcessCommandListFolder(TopLeveBranchFolder, true);
var _branchVersionID = vaultDirectory.Version;
The branch is being created. I'm able to verify this in the Vault Client. However, when I try to ProcessCommandListFolder on the parent directory of the newly created branch... I see the branch + .comparer. I suspect like you mentioned before, this issue is related to a commit. I can't find a ServerOperations.Commit so I'm trying to figure out what method commits the operation
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Tue May 15, 2012 10:43 am
by Beth
Just one more check to make sure I know exactly where this is at. Open a Vault web client by going to http://<your Vault server>/vaultservice/vaultweb. Login and browse to the location of the branch. Can you see it in the web client?
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Tue May 15, 2012 11:20 am
by nbuckle
Yes, I see the branch in the web client
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Tue May 15, 2012 1:13 pm
by Beth
If it's in the web client, then the branch has been fully committed.
Would it be possible to have you post a screenshot?
Re: ProcessCommandBranch() producing .comparer branch dir
Posted: Wed May 16, 2012 2:55 pm
by Beth
In addition to the last question I had, what happens if you try a listfolder using the Vault command-line client? The details on what you need are posted here:
http://download.sourcegear.com/misc/vau ... LISTFOLDER.
For example, your command might look like:
vault LISTFOLDER -host myVaultserver -user me -password mypassword -repository "Initial Repository" $/myMainfolder/mybranchfolder