patch: git delete mode shouldn't be used at all
authorMads Kiilerich <mads@kiilerich.com>
Mon, 26 Apr 2010 13:21:02 +0200
changeset 11020 dd157720a8ee
parent 11019 4fe28bdc27be
child 11021 c47a1cfad572
patch: git delete mode shouldn't be used at all
mercurial/patch.py
--- 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])