Exemplo n.º 1
0
 /// <summary>
 /// Removes all descendant files of a Directory to a changelog
 /// </summary>
 private static void AggregateRemove(ChangelogBuilder changelog, string prefix, VersionData original)
 {
     foreach (var child in original.Children)
     {
         string fpath = PrefixFilename(prefix, child.Filename);
         changelog.Remove(fpath);
         if (child.Filetype == FileType.Directory)
         {
             var subchangelog = BuildChangelog(child, null, fpath);
             changelog.Aggregate(subchangelog);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Finds objects that exist in one collection but not the other
 /// </summary>
 private static void FindAddRemoveds(ChangelogBuilder changelog, string prefix, VDKeyedCollection byName,
                                     VDKeyedCollection otherByName)
 {
     foreach (var pair in byName)
     {
         string fpath = PrefixFilename(prefix, pair.Filename);
         changelog.Remove(fpath);
         if (pair.Filetype == FileType.Directory)
         {
             var subchangelog = BuildChangelog(pair, null, fpath);
             changelog.Aggregate(subchangelog);
         }
     }
     foreach (var pair in otherByName)
     {
         string fpath = PrefixFilename(prefix, pair.Filename);
         changelog.Add(fpath, pair.Hash);
         if (pair.Filetype == FileType.Directory)
         {
             var subchangelog = BuildChangelog(null, pair, fpath);
             changelog.Aggregate(subchangelog);
         }
     }
 }