File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1
1
using System.CommandLine;
2
2
using System.CommandLine.NamingConventionBinder;
3
3
using System.Globalization;
4
+ using System.Linq;
4
5
using System.Text;
5
6
using LibGit2Sharp;
6
7
using Microsoft.TeamFoundation.SourceControl.WebApi;
@@ -526,7 +527,8 @@ private static async IAsyncEnumerable<MappingState> EnumerateMappingStatesAsync(
526
527
keySelector: mappingByBranch => mappingByBranch.Branch,
527
528
dependenciesSelector: mappingByBranch => additionalParents
528
529
.Where(b => b.Branch == mappingByBranch.Branch)
529
- .Select(b => b.ParentBranch))
530
+ .Select(b => b.ParentBranch)
531
+ .Where(branchMappings.ContainsKey)) // If the parent branch is also being deleted in the same commit, it doesn't affect the relative order
530
532
.ToImmutableArray();
531
533
532
534
yield return new MappingState(
Original file line number Diff line number Diff line change @@ -62,18 +62,6 @@ public IEnumerable<TopologicalOperation> GetTopologicalOperations(IReadOnlyList<
62
62
}
63
63
}
64
64
65
- foreach (var change in changesetChanges)
66
- {
67
- if (change.ChangeType.HasFlag(VersionControlChangeType.Delete) && currentBranchPaths.Remove(change.Item.Path))
68
- {
69
- if (change.ChangeType != VersionControlChangeType.Delete)
70
- throw new NotImplementedException("Poorly-understood combination");
71
-
72
- var deletedBranch = branchIdentifier.Delete(changeset, change.Item.Path);
73
- yield return new DeleteOperation(changeset, deletedBranch);
74
- }
75
- }
76
-
77
65
branchIdentifier.NoFurtherChangesUpTo(changeset - 1);
78
66
79
67
var (branches, merges) = GetBranchAndMergeOperations(changesetChanges, branchIdentifier);
@@ -89,6 +77,18 @@ public IEnumerable<TopologicalOperation> GetTopologicalOperations(IReadOnlyList<
89
77
{
90
78
yield return operation;
91
79
}
80
+
81
+ foreach (var change in changesetChanges)
82
+ {
83
+ if (change.ChangeType.HasFlag(VersionControlChangeType.Delete) && currentBranchPaths.Remove(change.Item.Path))
84
+ {
85
+ if (change.ChangeType != VersionControlChangeType.Delete)
86
+ throw new NotImplementedException("Poorly-understood combination");
87
+
88
+ var deletedBranch = branchIdentifier.Delete(changeset, change.Item.Path);
89
+ yield return new DeleteOperation(changeset, deletedBranch);
90
+ }
91
+ }
92
92
}
93
93
94
94
private static (ImmutableArray<BranchOperation> Branches, ImmutableArray<MergeOperation> Merges)
You can’t perform that action at this time.
0 commit comments