git patch: create empty added files

This commit is contained in:
Brendan Cully 2006-10-30 16:10:58 -08:00
parent 2e3c2f2949
commit 803c7dd950

View File

@ -369,6 +369,9 @@ def updatedir(ui, repo, patches, wlock=None):
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()