ProcessCommandBranch() producing .comparer branch dir

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

ProcessCommandBranch() producing .comparer branch dir

Post by nbuckle » Mon May 14, 2012 12:56 pm

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

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

Re: ProcessCommandBranch() producing .comparer branch dir

Post by Beth » Mon May 14, 2012 2:06 pm

Are you getting the branch committed prior to the label?
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: ProcessCommandBranch() producing .comparer branch dir

Post by nbuckle » Mon May 14, 2012 2:19 pm

When I perform the ServerLogin operations I set

ServerOperations.client.AutoCommit = true;

before I call my processcommandbranch()

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: ProcessCommandBranch() producing .comparer branch dir

Post by nbuckle » Mon May 14, 2012 3:13 pm

what should I call post branch to ensure that I get a Commit.

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

Re: ProcessCommandBranch() producing .comparer branch dir

Post by Beth » Mon May 14, 2012 3:17 pm

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?
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: ProcessCommandBranch() producing .comparer branch dir

Post by nbuckle » Tue May 15, 2012 9:28 am

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

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

Re: ProcessCommandBranch() producing .comparer branch dir

Post by Beth » Tue May 15, 2012 10:43 am

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?
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: ProcessCommandBranch() producing .comparer branch dir

Post by nbuckle » Tue May 15, 2012 11:20 am

Yes, I see the branch in the web client

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

Re: ProcessCommandBranch() producing .comparer branch dir

Post by Beth » Tue May 15, 2012 1:13 pm

If it's in the web client, then the branch has been fully committed.

Would it be possible to have you post a screenshot?
Beth Kieler
SourceGear Technical Support

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

Re: ProcessCommandBranch() producing .comparer branch dir

Post by Beth » Wed May 16, 2012 2:55 pm

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
Beth Kieler
SourceGear Technical Support

Post Reply