##// END OF EJS Templates
Fix issue1495, corner case of adding empty files via patching
Vsevolod Solovyov -
r7971:6ea0318d default
parent child Browse files
Show More
@@ -910,7 +910,7 b' def iterhunks(ui, fp, sourcefile=None):'
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
@@ -313,3 +313,22 b' rm b'
313 hg import --no-commit -v -s 100 ../rename.diff
313 hg import --no-commit -v -s 100 ../rename.diff
314 hg st -C
314 hg st -C
315 cd ..
315 cd ..
316
317
318 echo '% add empty file from the end of patch (issue 1495)'
319 hg init addemptyend
320 cd addemptyend
321 touch a
322 hg addremove
323 hg ci -m "commit"
324 cat > a.patch <<EOF
325 diff --git a/a b/a
326 --- a/a
327 +++ b/a
328 @@ -0,0 +1,1 @@
329 +a
330 diff --git a/b b/b
331 new file mode 100644
332 EOF
333 hg import --no-commit a.patch
334 cd ..
@@ -293,3 +293,6 b' removing a'
293 adding b
293 adding b
294 A b
294 A b
295 R a
295 R a
296 % add empty file from the end of patch (issue 1495)
297 adding a
298 applying a.patch
General Comments 0
You need to be logged in to leave comments. Login now