mercurial/patch.py
changeset 3588 45574a225632
parent 3540 da3ee7ca620f
child 3632 4cfb72bcb978
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()