mirror of
https://github.com/frej/fast-export.git
synced 2025-11-01 17:05:46 +01:00
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:
committed by
Frej Drejhammar
parent
7937dfaad5
commit
1be636db36
@@ -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=[],[],[],''
|
||||
|
||||
Reference in New Issue
Block a user