# HG changeset patch # User Dirkjan Ochtman # Date 2009-04-04 17:43:00 # Node ID 425a30ddfff6c8ada8cd7c63806cced92544b2ee # Parent a969b1470987b78c38e4fae757a9b1dd2e3b48e6 # Parent 6ea0318daf75b0b0b998f22f0cc33a8c2ba22905 merge with crew-stable diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -910,7 +910,7 @@ def iterhunks(ui, fp, sourcefile=None): # 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 --git a/tests/test-import b/tests/test-import --- a/tests/test-import +++ b/tests/test-import @@ -313,3 +313,22 @@ rm b 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 <