From 1be636db36e9dc6b1eda6fd2be5def84fce30773 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Mar 2014 00:12:44 -0700 Subject: [PATCH] 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. --- hg-fast-export.py | 6 ------ 1 file changed, 6 deletions(-) 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=[],[],[],'' -- 2.11.4.GIT