コード例 #1
0
        private bool updateConversionHistory(MigrationConflict conflict, ConflictResolutionRule rule, IServiceContainer serviceContainer)
        {
            if (!rule.DataFieldDictionary.ContainsKey(TfsCheckinFailureManualResolveAction.MigrationInstructionChangeId) ||
                !rule.DataFieldDictionary.ContainsKey(TfsCheckinFailureManualResolveAction.DeltaTableChangeId))
            {
                return(false);
            }

            ChangeGroupService changeGroupService       = serviceContainer.GetService(typeof(ChangeGroupService)) as ChangeGroupService;
            string             migrationInstructionName = rule.DataFieldDictionary[TfsCheckinFailureManualResolveAction.MigrationInstructionChangeId];
            string             deltaTableName           = rule.DataFieldDictionary[TfsCheckinFailureManualResolveAction.DeltaTableChangeId];
            string             comment = rule.RuleDescription;
            bool result = changeGroupService.UpdateConversionHistoryAndRemovePendingChangeGroups(migrationInstructionName, deltaTableName, comment);

            TraceManager.TraceInformation(string.Format("Conflict of type '{0}' resolved by updating history with new change versions: Source HighWaterMark: {1}; Target HighWaterMark: {2}",
                                                        conflict.ConflictType.FriendlyName, deltaTableName, migrationInstructionName));
            return(result);
        }