Adding and committing a Directory using the API

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

Moderator: SourceGear

Post Reply
fryhard
Posts: 6
Joined: Wed May 27, 2009 7:12 am

Adding and committing a Directory using the API

Post by fryhard » Thu Oct 29, 2009 1:05 am

I would like to add a directory to Vault and commit this operation using the API.

With little effort I am able to add and commit files to vault using this code:

Code: Select all

ChangeSetItemColl changeSetItemColl = ServerOperations.ProcessCommandAdd(pathDirectory, new[] { path });
ServerOperations.ProcessCommandCommit(changeSetItemColl, UnchangedHandler.Checkin, false, LocalCopyType.Leave, false);
But what I would really like to do is:

Code: Select all

ChangeSetItemColl changeSetItemColl = ServerOperations.ProcessCommandAdd(pathDirectory); // Add the path of the directory that we want to commit.
ServerOperations.ProcessCommandCommit(changeSetItemColl, UnchangedHandler.Checkin, false, LocalCopyType.Leave, false);
Is there any way to the above or do I need to run though the directory and its children and build up the ChangeSetItemColl and the commit it?

Thanks

shannon

Re: Adding and committing a Directory using the API

Post by shannon » Thu Oct 29, 2009 8:49 am

I'm sorry, there isn't a convenience method to do what you'd like. You'll have to build up the ChangeSetItemColl yourself.

Post Reply