mercurial/patch.py
changeset 14535 e597ef52a7c2
parent 14534 ecc79816d31e
child 14564 65f4512e40e4
--- a/mercurial/patch.py	Sun Jun 05 22:24:19 2011 +0200
+++ b/mercurial/patch.py	Sun Jun 05 22:26:01 2011 +0200
@@ -1237,12 +1237,12 @@
                 if gp.oldpath:
                     copysource = pstrip(gp.oldpath)
                 changed[path] = gp
-                if gp.op == 'DELETE':
-                    backend.unlink(path)
-                    continue
                 if gp.op == 'RENAME':
                     backend.unlink(copysource)
                 if not first_hunk:
+                    if gp.op == 'DELETE':
+                        backend.unlink(path)
+                        continue
                     data, mode = None, None
                     if gp.op in ('RENAME', 'COPY'):
                         data, mode = store.getfile(copysource)