# HG changeset patch # User Brendan Cully # Date 1162253458 28800 # Node ID 45574a22563285e8c0464f09ed1c5713cd1e194a # Parent c8494fcc9d392a7d1fadb120667a5c7eeea74afc git patch: create empty added files diff --git a/mercurial/patch.py b/mercurial/patch.py --- 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()