From: Kyle J. McKay Date: Sat, 15 Mar 2014 07:12:44 +0000 (-0700) Subject: hg-fast-export.py: do not sort merge commit parents X-Git-Tag: v160415~24 X-Git-Url: https://repo.or.cz/w/fast-export.git/commitdiff_plain/1be636db36e9dc6b1eda6fd2be5def84fce30773 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. --- diff --git a/hg-fast-export.py b/hg-fast-export.py index 90d334b..0d145fe 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -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=[],[],[],''