Skip to content

Commit f1abdf0

Browse files
committed
Deletes should be processed after branching or merging which might have referred to the deleted branch
1 parent b3d389e commit f1abdf0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/TfvcMigrator/TopologyAnalyzer.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ public IEnumerable<TopologicalOperation> GetTopologicalOperations(IReadOnlyList<
6262
}
6363
}
6464

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-
7765
branchIdentifier.NoFurtherChangesUpTo(changeset - 1);
7866

7967
var (branches, merges) = GetBranchAndMergeOperations(changesetChanges, branchIdentifier);
@@ -89,6 +77,18 @@ public IEnumerable<TopologicalOperation> GetTopologicalOperations(IReadOnlyList<
8977
{
9078
yield return operation;
9179
}
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+
}
9292
}
9393

9494
private static (ImmutableArray<BranchOperation> Branches, ImmutableArray<MergeOperation> Merges)

0 commit comments

Comments
 (0)