diff mercurial/patch.py @ 4006:67982d3ee76c

symlinks: add flags param to wwrite Now wwrite can set symlink and exec for files
author Matt Mackall <mpm@selenic.com>
date Fri, 29 Dec 2006 20:04:31 -0600
parents c190df14338c
children 49237d6ae97d
line wrap: on
line diff
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -377,8 +377,9 @@ def updatedir(ui, repo, patches, wlock=N
             dst = os.path.join(repo.root, gp.path)
             # patch won't create empty files
             if ctype == 'ADD' and not os.path.exists(dst):
-                repo.wwrite(gp.path, '')
-            util.set_exec(dst, x)
+                repo.wwrite(gp.path, '', x and 'x' or '')
+            else:
+                util.set_exec(dst, x)
     cmdutil.addremove(repo, cfiles, wlock=wlock)
     files = patches.keys()
     files.extend([r for r in removes if r not in files])