diff mercurial/patch.py @ 11020:dd157720a8ee

patch: git delete mode shouldn't be used at all
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 26 Apr 2010 13:21:02 +0200
parents 4fe28bdc27be
children c47a1cfad572
line wrap: on
line diff
--- a/mercurial/patch.py	Mon Apr 26 13:21:02 2010 +0200
+++ b/mercurial/patch.py	Mon Apr 26 13:21:02 2010 +0200
@@ -347,8 +347,6 @@
                 gp.path = line[8:]
             elif line.startswith('deleted file'):
                 gp.op = 'DELETE'
-                # is the deleted file a symlink?
-                gp.setmode(int(line[-6:], 8))
             elif line.startswith('new file mode '):
                 gp.op = 'ADD'
                 gp.setmode(int(line[-6:], 8))
@@ -1241,8 +1239,7 @@
             if gp.op == 'ADD' and not os.path.exists(dst):
                 flags = (isexec and 'x' or '') + (islink and 'l' or '')
                 repo.wwrite(gp.path, '', flags)
-            elif gp.op != 'DELETE':
-                util.set_flags(dst, islink, isexec)
+            util.set_flags(dst, islink, isexec)
     cmdutil.addremove(repo, cfiles, similarity=similarity)
     files = patches.keys()
     files.extend([r for r in removes if r not in files])