mirror of
https://github.com/frej/fast-export.git
synced 2025-11-02 17:25:48 +01:00
Commits with no parent need a reset command.
This fixes a problem where a repository is imported incorrectly when there is a merge between two branches with no common history.
This commit is contained in:
committed by
Frej Drejhammar
parent
0a9570c676
commit
e24fa42b87
@@ -161,6 +161,11 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,sob,brmap):
|
|||||||
|
|
||||||
branch=get_branchname(branch)
|
branch=get_branchname(branch)
|
||||||
|
|
||||||
|
parents = [p for p in repo.changelog.parentrevs(revision) if p >= 0]
|
||||||
|
|
||||||
|
if len(parents)==0 and revision != 0:
|
||||||
|
wr('reset refs/heads/%s' % branch)
|
||||||
|
|
||||||
wr('commit refs/heads/%s' % branch)
|
wr('commit refs/heads/%s' % branch)
|
||||||
wr('mark :%d' % (revision+1))
|
wr('mark :%d' % (revision+1))
|
||||||
if sob:
|
if sob:
|
||||||
@@ -170,7 +175,6 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,sob,brmap):
|
|||||||
wr(desc)
|
wr(desc)
|
||||||
wr()
|
wr()
|
||||||
|
|
||||||
parents = [p for p in repo.changelog.parentrevs(revision) if p >= 0]
|
|
||||||
|
|
||||||
# Sort the parents based on revision ids so that we always get the
|
# Sort the parents based on revision ids so that we always get the
|
||||||
# same resulting git repo, no matter how the revisions were
|
# same resulting git repo, no matter how the revisions were
|
||||||
|
|||||||
Reference in New Issue
Block a user