Exemplo n.º 1
0
        public int Checkin(string comment, WorkItem[] workItems)
        {
            CheckPathsDefined();

            WorkItemCheckinInfo[] wiCheckinInfos = workItems.Select(it =>
                                                                    new WorkItemCheckinInfo(it, WorkItemCheckinAction.Associate)).ToArray();

            PendingChange[] pendingChanges = GetPendingChanges();

            Output.WriteLine("Checking in {0} pending changes...", pendingChanges.Count());

            if (!pendingChanges.Any())
            {
                throw new MyTfsConnectionException("There were no changes to merge (trying to check in zero pending changes)");
            }

            int checkinId = WorkSpace.CheckIn(pendingChanges, comment, null, wiCheckinInfos.ToArray(),
                                              new PolicyOverrideInfo(overrideComment: string.Empty, policyFailures: null));

            Output.WriteLine($"Checkin complete; checkin ID {checkinId}\n");
            return(checkinId);
        }