Mercurial > public > mercurial-scm > hg
comparison mercurial/patch.py @ 3588:45574a225632
git patch: create empty added files
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Mon, 30 Oct 2006 16:10:58 -0800 |
parents | da3ee7ca620f |
children | 4cfb72bcb978 |
comparison
equal
deleted
inserted
replaced
3587:c8494fcc9d39 | 3588:45574a225632 |
---|---|
367 for f in patches: | 367 for f in patches: |
368 ctype, gp = patches[f] | 368 ctype, gp = patches[f] |
369 if gp and gp.mode: | 369 if gp and gp.mode: |
370 x = gp.mode & 0100 != 0 | 370 x = gp.mode & 0100 != 0 |
371 dst = os.path.join(repo.root, gp.path) | 371 dst = os.path.join(repo.root, gp.path) |
372 # patch won't create empty files | |
373 if ctype == 'ADD' and not os.path.exists(dst): | |
374 repo.wwrite(gp.path, '') | |
372 util.set_exec(dst, x) | 375 util.set_exec(dst, x) |
373 cmdutil.addremove(repo, cfiles, wlock=wlock) | 376 cmdutil.addremove(repo, cfiles, wlock=wlock) |
374 files = patches.keys() | 377 files = patches.keys() |
375 files.extend([r for r in removes if r not in files]) | 378 files.extend([r for r in removes if r not in files]) |
376 files.sort() | 379 files.sort() |