mercurial/patch.py
changeset 3588 45574a225632
parent 3540 da3ee7ca620f
child 3632 4cfb72bcb978
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -369,6 +369,9 @@ def updatedir(ui, repo, patches, wlock=N
         if gp and gp.mode:
             x = gp.mode & 0100 != 0
             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)
     cmdutil.addremove(repo, cfiles, wlock=wlock)
     files = patches.keys()