changeset 10524:3212afb33116 stable

patch: fix patching with fuzz and eol normalization
author Patrick Mezard <pmezard@gmail.com>
date Mon, 22 Feb 2010 22:55:58 +0100
parents 4bab7c3db4e1
children cc2d296c1d4c
files mercurial/patch.py tests/test-import tests/test-import.out
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Feb 21 15:26:55 2010 +0100
+++ b/mercurial/patch.py	Mon Feb 22 22:55:58 2010 +0100
@@ -657,6 +657,7 @@
         nh = hunk(self.desc, self.number, None, None, False, False)
         nh.number = self.number
         nh.desc = self.desc
+        nh.hunk = self.hunk
         nh.a = normalize(self.a)
         nh.b = normalize(self.b)
         nh.starta = self.starta
--- a/tests/test-import	Sun Feb 21 15:26:55 2010 +0100
+++ b/tests/test-import	Mon Feb 22 22:55:58 2010 +0100
@@ -196,7 +196,10 @@
 echo line1 >> a
 echo line0 >> a
 hg ci -m brancha
-hg import -v tip.patch
+hg import --no-commit -v tip.patch
+hg revert -a
+echo '% test fuzziness with eol=auto'
+hg --config patch.eol=auto import --no-commit -v tip.patch
 cd ..
 
 # Test hunk touching empty files (issue906)
--- a/tests/test-import.out	Sun Feb 21 15:26:55 2010 +0100
+++ b/tests/test-import.out	Mon Feb 22 22:55:58 2010 +0100
@@ -205,7 +205,11 @@
 applying tip.patch
 patching file a
 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
-a
+reverting a
+% test fuzziness with eol=auto
+applying tip.patch
+patching file a
+Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
 adding a
 adding b1
 adding c1