diff --git a/hg-fast-export.py b/hg-fast-export.py index 6de1e0a..cdb838b 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -180,8 +180,10 @@ def export_commit(ui,repo,revision,marks,mapping,heads,last,max,count,authors,so wr() pidx1, pidx2 = 0, 1 - if parents[0] < parents[1]: - pidx1, pidx2 = 1, 0 + if parents[1] > 0: + if parents[0] <= 0 or \ + repo.changelog.node(parents[0]) < repo.changelog.node(parents[1]): + pidx1, pidx2 = 1, 0 full_rev=False if revision==0: full_rev=True