patch: fix patching with fuzz and eol normalization stable
authorPatrick Mezard <pmezard@gmail.com>
Mon, 22 Feb 2010 22:55:58 +0100
branchstable
changeset 10524 3212afb33116
parent 10523 4bab7c3db4e1
child 10525 cc2d296c1d4c
patch: fix patching with fuzz and eol normalization
mercurial/patch.py
tests/test-import
tests/test-import.out
--- 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