示例#1
0
 public void Fixup(VobDB vobDB)
 {
     _rawHistoryBuilder = new RawHistoryBuilder(null);
     _rawHistoryBuilder.SetBranchFilters(_branchFilters);
     if (_rawElementsNamesByBranch != null)
     {
         foreach (var pair in _rawElementsNamesByBranch)
         {
             var elements = new Dictionary <Element, HashSet <string> >();
             _elementsNamesByBranch.Add(pair.Key, elements);
             foreach (var nameByOid in pair.Value)
             {
                 Element element;
                 if (!vobDB.ElementsByOid.TryGetValue(nameByOid.Key, out element))
                 {
                     Logger.TraceData(TraceEventType.Warning, (int)TraceId.CreateChangeSet, "Could not find element with oid " + nameByOid.Key + " in loaded vobDB");
                     continue;
                 }
                 var names = new HashSet <string>(nameByOid.Value);
                 elements.Add(element, names);
             }
         }
         _rawElementsNamesByBranch = null;
     }
     if (_rawElementsVersionsByBranch != null)
     {
         foreach (var pair in _rawElementsVersionsByBranch)
         {
             var elements = new Dictionary <Element, ElementVersion>();
             _elementsVersionsByBranch.Add(pair.Key, elements);
             foreach (var versionByOid in pair.Value)
             {
                 Element element;
                 if (!vobDB.ElementsByOid.TryGetValue(versionByOid.Key, out element))
                 {
                     Logger.TraceData(TraceEventType.Warning, (int)TraceId.CreateChangeSet, "Could not find element with oid " + versionByOid.Key + " in loaded vobDB");
                     continue;
                 }
                 elements.Add(element, element.GetVersion(versionByOid.Value.BranchName, versionByOid.Value.VersionNumber));
             }
         }
         _rawElementsVersionsByBranch = null;
     }
     if (_rawBranchTips != null)
     {
         foreach (var branchTip in _rawBranchTips)
         {
             // creating dummy changeSets : they will never be used except for their Id
             _branchTips.Add(branchTip.Key, new ChangeSet("dummy", "dummy", branchTip.Key, DateTime.Now)
             {
                 Id = branchTip.Value
             });
         }
         _rawBranchTips = null;
     }
     if (_rawStartedBranches != null)
     {
         foreach (var startedBranch in _rawStartedBranches)
         {
             // creating dummy changeSets : they will never be used except for their Id
             _startedBranches.Add(startedBranch.Key, startedBranch.Value == 0 ? null : new ChangeSet("dummy", "dummy", startedBranch.Key, DateTime.Now)
             {
                 Id = startedBranch.Value
             });
         }
         _rawStartedBranches = null;
     }
 }
示例#2
0
 public HistoryBuilder(VobDB vobDB)
 {
     _rawHistoryBuilder = new RawHistoryBuilder(vobDB);
 }