Mass Check-In

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

Moderator: SourceGear

Post Reply
mchandler
Posts: 5
Joined: Thu Oct 09, 2008 8:47 am

Mass Check-In

Post by mchandler » Tue Mar 24, 2009 8:57 am

I am working on a project to do some vault automation to check in a very large number of files. To do this, I am trying to use a list of checked out files from a VaultClientCheckOutList object, then I build a string[] to pass to the ProcessCommandCheckIn method. The issue I am having is that I cannot seem to find how to iterate through and retreive the vault paths from the VaultClientCheckOutList object. There is no Item method and the IndexOf method requires values that I don't seem to have. Does anyone have any advice they could give me on this? Or possibly, has anyone been able to write code that will in some other way check-in a large volume of files?

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Re: Mass Check-In

Post by jeremy_sg » Tue Mar 24, 2009 12:48 pm

A couple of things to try: 1. You can use a wildcard to do checkins with the format: "$/trunk/src/**/*", which would check in every item below src. Also, you can use a local path as well.
Subscribe to the Fortress/Vault blog

mchandler
Posts: 5
Joined: Thu Oct 09, 2008 8:47 am

Re: Mass Check-In

Post by mchandler » Tue Mar 24, 2009 2:39 pm

Thanks for the help. I got file paths to work, but I am having trouble using wildcards, see my code below:

string filePath = "$/BMC/2.84/**/*";
ServerOperations.ProcessCommandCheckIn(new string[] { filePath }, UnchangedHandler.UndoCheckout, bKeepCheckedOut, LocalCopyType.Leave);

I get a 'Commit failed' error if i try to run this, is there something wrong with this command that would cause this? Also, I tried to set up wildcards on a local path with no success as well.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Re: Mass Check-In

Post by jeremy_sg » Tue Mar 24, 2009 3:09 pm

Make sure that you hook into the ServerOperations.UserMessage event to catch the error message that will give you more details on the failed commit. I would expect that there are incompatible changeset requests that can't be committed at the same time.
Subscribe to the Fortress/Vault blog

mchandler
Posts: 5
Joined: Thu Oct 09, 2008 8:47 am

Re: Mass Check-In

Post by mchandler » Wed Mar 25, 2009 7:49 am

Thanks, I'll give that a shot, if I still can't get a solution, I will try to build an array of local file paths.

Post Reply