# HG changeset patch # User Patrick Mezard # Date 1348601656 -7200 # Node ID 4d9e80f6ba43ff36475982efd8039a915128985d # Parent febca88dd2616fdd6f784aa8915f0dfafc1a09dd editor: do not touch RevisionData copies from the editor Copy source can be passed when adding the file to the revision data. diff --git a/hgsubversion/editor.py b/hgsubversion/editor.py --- a/hgsubversion/editor.py +++ b/hgsubversion/editor.py @@ -49,7 +49,7 @@ class RevisionData(object): self.externals = {} self.exception = None - def set(self, path, data, isexec=False, islink=False): + def set(self, path, data, isexec=False, islink=False, copypath=None): self.files[path] = data self.execfiles[path] = isexec self.symlinks[path] = islink @@ -57,6 +57,8 @@ class RevisionData(object): del self.deleted[path] if path in self.missing: self.missing.remove(path) + if copypath is not None: + self.copies[path] = copypath def delete(self, path): self.deleted[path] = True @@ -286,9 +288,7 @@ class HgEditor(svnwrap.Editor): % file_baton) path, data, isexec, islink, copypath = self._openfiles.pop(file_baton) del self._openpaths[path] - self.current.set(path, data, isexec, islink) - if copypath is not None: - self.current.copies[path] = copypath + self.current.set(path, data, isexec, islink, copypath) @svnwrap.ieditor def add_directory(self, path, parent_baton, copyfrom_path, @@ -473,8 +473,7 @@ class HgEditor(svnwrap.Editor): ctx = self.repo[node] for path, copy in copies: data, isexec, islink, copied = copy.resolve(self.repo, ctx) - self.current.set(path, data, isexec, islink) - self.current.copies[path] = copied + self.current.set(path, data, isexec, islink, copied) self._svncopies.clear() for f in self._deleted: