hg-fast-export.py: do not sort merge commit parents

In a merge commit, the first parent is always the same parent that
would be recorded if the commit were not a merge and the other
parent(s) record the commit(s) being merged in.

Preserving this order is important so that log --first-parent works
properly and also so that the merge history is not distorted by an
incorrect permutation of the DAG.

Remove the code that sorts the merge parents based on node id so
that the correct DAG order is preserved.
This commit is contained in:
Kyle J. McKay
2014-03-15 00:12:44 -07:00
committed by Frej Drejhammar
parent 7937dfaad5
commit 1be636db36

View File

@@ -182,12 +182,6 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,sob,brmap,hgtags)
wr(desc)
wr()
# Sort the parents based on revision ids so that we always get the
# same resulting git repo, no matter how the revisions were
# numbered.
parents.sort(key=repo.changelog.node, reverse=True)
ctx=repo.changectx(str(revision))
man=ctx.manifest()
added,changed,removed,type=[],[],[],''