mercurial/patch.py
changeset 6791 bbd89c9e6012
parent 6520 ba0b2dacc623
child 6792 b2c4be19d7b1
child 6877 1d38f3605b20
--- a/mercurial/patch.py	Tue Jul 01 23:41:47 2008 +0100
+++ b/mercurial/patch.py	Wed Jun 25 14:13:20 2008 -0700
@@ -1039,9 +1039,12 @@
                 continue
         elif state == 'git':
             gitpatches = values
+            cwd = os.getcwd()
             for gp in gitpatches:
                 if gp.op in ('COPY', 'RENAME'):
-                    copyfile(gp.oldpath, gp.path)
+                    src, dst = [util.canonpath(cwd, cwd, x)
+                                for x in [gp.oldpath, gp.path]]
+                    copyfile(src, dst)
                 changed[gp.path] = (gp.op, gp)
         else:
             raise util.Abort(_('unsupported parser state: %s') % state)