# HG changeset patch # User Patrick Mezard # Date 1267545966 -3600 # Node ID 704d2ce1d906da96d9451071159f26701087ff58 # Parent c3ba4ca81d16af0dbc3e7599c72fdc9e7a2dc732 editor: fix open_file() on replaced branch The mercurial parent revision was the replacing branch revision not the replaced one. diff --git a/hgsubversion/editor.py b/hgsubversion/editor.py --- a/hgsubversion/editor.py +++ b/hgsubversion/editor.py @@ -166,17 +166,20 @@ class HgEditor(delta.Editor): if self.current.file in self.current.files: return + if not self.meta.is_path_valid(path): + return + baserev = base_revision if baserev is None or baserev == -1: baserev = self.current.rev.revnum - 1 - parent = self.meta.get_parent_revision(baserev + 1, branch) - + # Use exact=True because during replacements ('R' action) we select + # replacing branch as parent, but svn delta editor provides delta + # agains replaced branch. + parent = self.meta.get_parent_revision(baserev + 1, branch, True) ctx = self.repo[parent] - if not self.meta.is_path_valid(path): - return - if fpath not in ctx: self.current.missing.add(path) + return fctx = ctx.filectx(fpath) base = fctx.data()