Skip to content

Commit

Permalink
Ordering the changesets by ID to correct the branching point (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Raga committed Jan 13, 2013
1 parent 095824c commit 14de51d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs
Expand Up @@ -57,12 +57,14 @@ public override int GetRootChangesetForBranch(string tfsPathBranchToCreate, stri
if (firstChangesetInBranchToCreate == null)
{
throw new GitTfsException("An unexpected error occured when trying to find the root changeset.\nFailed to find first changeset for " + tfsPathBranchToCreate);
}

var mergedItemsToFirstChangesetInBranchToCreate =
VersionControl.TrackMerges(new int[] {firstChangesetInBranchToCreate.ChangesetId},
new ItemIdentifier(tfsPathBranchToCreate),
new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch),}, null);
}

var mergedItemsToFirstChangesetInBranchToCreate = VersionControl
.TrackMerges(new int[] {firstChangesetInBranchToCreate.ChangesetId},
new ItemIdentifier(tfsPathBranchToCreate),
new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch),},
null)
.OrderBy(x => x.SourceChangeset.ChangesetId);

var lastChangesetsMergeFromParentBranch = mergedItemsToFirstChangesetInBranchToCreate.LastOrDefault();

Expand Down

0 comments on commit 14de51d

Please sign in to comment.