public void PopulateDirectoryContents(HistoryBuilder builder, DirectoryElementBranchVersion directory)
 {
     foreach (var entry in Contents)
     {
         directory.AddElement(entry.Key, builder.GetElementByOid(entry.Value));
     }
 }
 public CaseHistoryAssemblerPolicy(IClarifySession session, HistoryBuilder historyBuilder,
     HistorySettings historySettings, ILogger logger)
 {
     _session = session;
     _historyBuilder = historyBuilder;
     _historySettings = historySettings;
     _logger = logger;
 }
 public CaseHistoryAssemblerPolicy(IClarifySession session, HistoryBuilder historyBuilder,
                                   HistorySettings historySettings, ILogger logger)
 {
     _session         = session;
     _historyBuilder  = historyBuilder;
     _historySettings = historySettings;
     _logger          = logger;
 }
        public override void ApplyTo(HistoryBuilder builder)
        {
            if (HyperlinkType != "Merge")
            {
                Logger.LogInformation("Ignoring unknown hyperlink type {type} from {from} to {to}", HyperlinkType, HyperlinkFrom, HyperlinkTo);
                return;
            }

            builder.AddPendingHyperlink(Oid, HyperlinkFrom, HyperlinkTo);
        }
예제 #5
0
 public override void ApplyTo(HistoryBuilder builder)
 {
     if (IsDirectory)
     {
         builder.AddNewDirectoryElement(Oid, ElementName);
     }
     else
     {
         builder.AddNewFileElement(Oid, ElementName);
     }
 }
        public override void ApplyTo(HistoryBuilder builder)
        {
            // Special types such as LATEST, CHECKEDOUT and BACKSTOP are still
            // labels.
            List <string> specialLabels = new() { "LATEST", "CHECKEDOUT", "BACKSTOP" };

            if (specialLabels.Contains(LabelTypeName))
            {
                return;
            }
            builder.AddLabel(new(LabelTypeName, Date, AuthorName, AuthorLogin));
        }
        public override void ApplyTo(HistoryBuilder builder)
        {
            Element       element         = builder.GetElement(ElementName);
            ElementBranch elementBranch   = element.GetFullBranch(FullBranch);
            var           previousVersion = PreviousFullBranchVersion == null ? null : element.GetFullBranch(PreviousFullBranch).GetVersion(PreviousVersion);

            elementBranch.CreateDirectoryVersion(previousVersion, Oid, Version, Date, AuthorName, AuthorLogin, Labels, Comment);
            var elementVersion = elementBranch.GetVersion(Version) as DirectoryElementBranchVersion;

            PopulateDirectoryContents(builder, elementVersion);

            // Do not add zero versions since they might never be claimed.
            if (Version != 0)
            {
                builder.AddUnreferencedVersion(elementVersion);
            }

            HashSet <string> branches       = builder.GetShortBranches();
            string           shortBranch    = builder.GetShortBranchMapping(FullBranch);
            ChangeSet        changeSet      = new(Date, AuthorName, AuthorLogin, shortBranch);
            bool             changeSetAdded = builder.ForceBuildTreeChanged(changeSet, FullBranch);

            if (changeSetAdded && elementVersion.VersionNumber == 0 && elementVersion.PreviousVersion != null)
            {
                ChangeSet branchedFrom = builder.FindBranchedFrom(elementVersion.PreviousVersion);
                if (branchedFrom != null && branchedFrom.Branch != ShortBranch)
                {
                    changeSet.AddBranchedFrom(branchedFrom);
                }
            }
            branches.Remove(shortBranch);

            foreach (var branch in branches)
            {
                ChangeSet branchChange = new(Date, AuthorName, AuthorLogin, branch);
                builder.ForceBuildTreeChanged(branchChange, FullBranch);
            }
        }
예제 #8
0
 public abstract void ApplyTo(HistoryBuilder builder);
 public override void ApplyTo(HistoryBuilder builder)
 {
     builder.AddNewSymlinkElement(Oid, Date, AuthorName, AuthorLogin, ElementName, SymlinkTarget);
 }
 public DefaultHistoryAssemblerPolicy(HistoryBuilder historyBuilder)
 {
     _historyBuilder = historyBuilder;
 }
 public DefaultHistoryAssemblerPolicy(HistoryBuilder historyBuilder)
 {
     _historyBuilder = historyBuilder;
 }
예제 #12
0
        //TODO add settings object to allow getting subcases to be configurable - default (do not get subcase)

        public CaseHistoryAssemblerPolicy(IClarifySessionCache sessionCache, HistoryBuilder historyBuilder, HistorySettings historySettings)
        {
            _sessionCache    = sessionCache;
            _historyBuilder  = historyBuilder;
            _historySettings = historySettings;
        }
예제 #13
0
 public override void ApplyTo(HistoryBuilder builder)
 {
     builder.GetElement(ElementName).CreateBranch(Oid, FullBranch, ShortBranch);
     builder.AddShortBranchMapping(FullBranch, ShortBranch);
 }