diff options
Diffstat (limited to 'hgsubversion/replay.py')
-rw-r--r-- | hgsubversion/replay.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/hgsubversion/replay.py b/hgsubversion/replay.py index ee754ce..777fee8 100644 --- a/hgsubversion/replay.py +++ b/hgsubversion/replay.py @@ -65,13 +65,13 @@ def _convert_rev(ui, meta, svn, r, tbdelta, firstrun): editor.current.rev = r editor.setsvn(svn) - if firstrun and meta.firstpulled <= 0: + if firstrun and meta.revmap.firstpulled <= 0: # We know nothing about this project, so fetch everything before # trying to apply deltas. ui.debug('replay: fetching full revision\n') svn.get_revision(r.revnum, editor) else: - svn.get_replay(r.revnum, editor, meta.firstpulled) + svn.get_replay(r.revnum, editor, meta.revmap.firstpulled) editor.close() current = editor.current @@ -103,7 +103,7 @@ def _convert_rev(ui, meta, svn, r, tbdelta, firstrun): closebranches = {} for branch in tbdelta['branches'][1]: - branchedits = meta.revmap.branchedits(branch, rev) + branchedits = meta.revmap.branchedits(branch, rev.revnum) if len(branchedits) < 1: # can't close a branch that never existed continue @@ -121,6 +121,12 @@ def _convert_rev(ui, meta, svn, r, tbdelta, firstrun): if branch in current.emptybranches and files: del current.emptybranches[branch] + if meta.skipbranch(branch): + # make sure we also get rid of it from emptybranches + if branch in current.emptybranches: + del current.emptybranches[branch] + continue + files = dict(files) parents = meta.get_parent_revision(rev.revnum, branch), revlog.nullid if parents[0] in closedrevs and branch in meta.closebranches: @@ -175,6 +181,8 @@ def _convert_rev(ui, meta, svn, r, tbdelta, firstrun): copied=copied) meta.mapbranch(extra) + if 'branch' not in extra: + extra['branch'] = 'default' current_ctx = context.memctx(meta.repo, parents, meta.getmessage(rev), @@ -195,6 +203,9 @@ def _convert_rev(ui, meta, svn, r, tbdelta, firstrun): # 2. handle branches that need to be committed without any files for branch in current.emptybranches: + if meta.skipbranch(branch): + continue + ha = meta.get_parent_revision(rev.revnum, branch) if ha == node.nullid: continue |