Mercurial > hgsubversion
diff hgsubversion/editor.py @ 1235:6b15eeb78c1a
editor: fix replay handling for copied + modified symlinks
We strip the 'link ' prefix from symlinks when we store it in
Mercurial. We reapply it when we start editing the file via
open_file, but not via add_file. this means that modified symlniks
would replay correctly, but not copied and modified symlinks. This
corrects that ommission.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Mon, 07 Apr 2014 18:44:46 -0700 |
parents | d3c79072bc6a |
children | 759cafce6bec |
line wrap: on
line diff
--- a/hgsubversion/editor.py +++ b/hgsubversion/editor.py @@ -380,7 +380,10 @@ class HgEditor(svnwrap.Editor): fctx = ctx.filectx(from_file) flags = fctx.flags() - self.current.set(path, fctx.data(), 'x' in flags, 'l' in flags) + base = fctx.data() + if 'l' in flags: + base = 'link ' + base + self.current.set(path, base, 'x' in flags, 'l' in flags) copypath = None if from_branch == branch: parentid = self.meta.get_parent_revision( @@ -389,7 +392,7 @@ class HgEditor(svnwrap.Editor): parentctx = self._getctx(parentid) if util.issamefile(parentctx, ctx, from_file): copypath = from_file - return self._openfile(path, fctx.data(), 'x' in flags, 'l' in flags, + return self._openfile(path, base, 'x' in flags, 'l' in flags, copypath, create=True) @svnwrap.ieditor