# HG changeset patch # User Dirkjan Ochtman # Date 1238866980 -7200 # Node ID 425a30ddfff6c8ada8cd7c63806cced92544b2ee # Parent a969b1470987b78c38e4fae757a9b1dd2e3b48e6# Parent 6ea0318daf75b0b0b998f22f0cc33a8c2ba22905 merge with crew-stable diff -r a969b1470987 -r 425a30ddfff6 mercurial/patch.py --- a/mercurial/patch.py Sat Apr 04 18:08:41 2009 +0200 +++ b/mercurial/patch.py Sat Apr 04 19:43:00 2009 +0200 @@ -910,7 +910,7 @@ # else error? # copy/rename + modify should modify target, not source gp = changed.get(bfile) - if gp and gp.op in ('COPY', 'DELETE', 'RENAME'): + if gp and gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD'): afile = bfile gitworkdone = True newfile = True diff -r a969b1470987 -r 425a30ddfff6 tests/test-import --- a/tests/test-import Sat Apr 04 18:08:41 2009 +0200 +++ b/tests/test-import Sat Apr 04 19:43:00 2009 +0200 @@ -313,3 +313,22 @@ hg import --no-commit -v -s 100 ../rename.diff hg st -C cd .. + + +echo '% add empty file from the end of patch (issue 1495)' +hg init addemptyend +cd addemptyend +touch a +hg addremove +hg ci -m "commit" +cat > a.patch <