Example #1
0
        private ChangeGroup createMigrationAction(CCHistoryRecord historyRecord, Guid actionId)
        {
            string versionExtendedPath;

            if (m_clearCaseServer.UsePrecreatedView)
            {
                versionExtendedPath = historyRecord.VersionExtendedPath;
            }
            else
            {
                versionExtendedPath =
                    ClearCasePath.removeViewLocationFromVersion(historyRecord.VersionExtendedPath, m_clearCaseServer.ViewRootPath);
            }
            ChangeGroup oldChangeGroup;
            ChangeGroup currentChangeGroup = m_changeGroupService.AddMigrationActionToDeltaTable(historyRecord.EventId.ToString(CultureInfo.InvariantCulture),
                                                                                                 historyRecord.Comment,
                                                                                                 null,
                                                                                                 historyRecord.EventId,
                                                                                                 actionId,
                                                                                                 new ClearCaseMigrationItem(
                                                                                                     m_ccConfiguration.GetViewName("Analysis"),
                                                                                                     versionExtendedPath,
                                                                                                     historyRecord.IsDirectory),
                                                                                                 historyRecord.AbsoluteVobPathFrom,
                                                                                                 historyRecord.AbsoluteVobPath,
                                                                                                 null,
                                                                                                 null,
                                                                                                 historyRecord.IsDirectory ? WellKnownContentType.VersionControlledFolder.ReferenceName
                : WellKnownContentType.VersionControlledFile.ReferenceName,
                                                                                                 null,
                                                                                                 historyRecord.VersionTime,
                                                                                                 out oldChangeGroup);

            m_hwmEventId.Update(historyRecord.EventId);

            if ((oldChangeGroup != null) && (oldChangeGroup != currentChangeGroup))
            {
                oldChangeGroup.Save();
                m_changeGroupService.PromoteDeltaToPending();
                m_hwmDelta.Update(historyRecord.VersionTime);
            }
            return(currentChangeGroup);
        }