Sample for check in via API (V.3)

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

Moderator: SourceGear

Post Reply
sahaas
Posts: 4
Joined: Sat Aug 04, 2007 6:29 am

Sample for check in via API (V.3)

Post by sahaas » Mon Aug 06, 2007 5:12 am

Hello,

im locking for a Example how I can check in some files via API (V.3)!

thanks alot!

best regards

S. Haas

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

Post by jeremy_sg » Mon Aug 06, 2007 7:17 am

Take a look at the example code at http://weblogs.asp.net/jeremy_sheeley

sahaas
Posts: 4
Joined: Sat Aug 04, 2007 6:29 am

Post by sahaas » Tue Aug 07, 2007 10:14 am

hello jeremy_sg,

thanks alot for help!

Unfortunally I´m looking for a method to check a file single in!

The Commit Methode commit all changes... or???

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

Post by jeremy_sg » Tue Aug 07, 2007 11:00 am

You can find which change set item you want to check in by looping over the InternalChangeSet in clientInstance. Here's some very rough code to get you started.

Code: Select all

ChangeSetItemColl csic = ClientInstance.InternalChangeSet_GetItems(true);
if ( (csic != null) && (csic.Count > 0) )
{
   for (int j = 0; j < csic.Count; j++)
   {
      ChangeSetItem csiItem = csicOld[j];
      if   (csiItem.DisplayRepositoryPath.ToLower().Equals(MYPATH.ToLower()))
      {
         ChangeSetItemColl csicNew = new ChangeSetItemColl();
         csicNew.Add(csiItem);
         ClientInstance.Commit(csicNew);
      } 
   }
}

sahaas
Posts: 4
Joined: Sat Aug 04, 2007 6:29 am

Post by sahaas » Wed Aug 08, 2007 2:08 am

thats works! Thanks for help!

Post Reply