public int CheckIn(PendingChange[] changes, string comment) { if (changes.Length == 0) { return(0); } List <string> serverItems = new List <string>(); SortedList <string, PendingChange> changesByServerPath = new SortedList <string, PendingChange>(); foreach (PendingChange change in changes) { // upload new or changed files only if ((change.ItemType == ItemType.File) && (change.IsAdd || change.IsEdit)) { Repository.CheckInFile(Name, OwnerName, change); SetFileAttributes(change.LocalItem); } serverItems.Add(change.ServerItem); changesByServerPath.Add(change.ServerItem, change); } SortedList <string, bool> undoneServerItems = new SortedList <string, bool>(); int cset = Repository.CheckIn(this, serverItems.ToArray(), comment, ref undoneServerItems); foreach (string undoneItem in undoneServerItems.Keys) { PendingChange change = changesByServerPath[undoneItem]; VersionControlServer.OnUndonePendingChange(this, change); } return(cset); }