comparison mercurial/patch.py @ 7971:6ea0318daf75

Fix issue1495, corner case of adding empty files via patching
author Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
date Tue, 24 Mar 2009 23:28:55 +0000
parents 162fd31bbd93
children 425a30ddfff6
comparison
equal deleted inserted replaced
7970:fd22d7c7b302 7971:6ea0318daf75
908 for gp in gitpatches: 908 for gp in gitpatches:
909 changed[gp.path] = gp 909 changed[gp.path] = gp
910 # else error? 910 # else error?
911 # copy/rename + modify should modify target, not source 911 # copy/rename + modify should modify target, not source
912 gp = changed.get(bfile) 912 gp = changed.get(bfile)
913 if gp and gp.op in ('COPY', 'DELETE', 'RENAME'): 913 if gp and gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD'):
914 afile = bfile 914 afile = bfile
915 gitworkdone = True 915 gitworkdone = True
916 newfile = True 916 newfile = True
917 elif x.startswith('---'): 917 elif x.startswith('---'):
918 # check for a unified diff 918 # check for a unified diff