# HG changeset patch # User Patrick Mezard # Date 1267545966 -3600 # Node ID c3ba4ca81d16af0dbc3e7599c72fdc9e7a2dc732 # Parent d000b9a361e4824ba15d3eaab6c0adef220dc264 editor: fix replaced files content in replay mode diff --git a/hgsubversion/editor.py b/hgsubversion/editor.py --- a/hgsubversion/editor.py +++ b/hgsubversion/editor.py @@ -209,8 +209,11 @@ class HgEditor(delta.Editor): if not from_file: self.current.missing.add(path) return + # Use exact=True because during replacements ('R' action) we select + # replacing branch as parent, but svn delta editor provides delta + # agains replaced branch. ha = self.meta.get_parent_revision(copyfrom_revision + 1, - from_branch) + from_branch, True) ctx = self.repo.changectx(ha) if from_file in ctx: fctx = ctx.filectx(from_file) diff --git a/tests/test_fetch_branches.py b/tests/test_fetch_branches.py --- a/tests/test_fetch_branches.py +++ b/tests/test_fetch_branches.py @@ -145,8 +145,7 @@ class TestFetchBranches(test_util.TestBa self.assertEqual('0', ctx.extra().get('close', '0')) self.assertEqual('branch1', ctx.branch()) self.assertEqual('c\n', ctx['c'].data()) - # a replacement does not work yet - #self.assertEqual('d\n', ctx['a'].data()) + self.assertEqual('d\n', ctx['a'].data()) def test_replace_branch_with_branch_stupid(self, stupid=False): self.test_replace_branch_with_branch(True)