# HG changeset patch # User Patrick Mezard # Date 1266875758 -3600 # Node ID 3212afb331168e34e253c7c58a2700146b9b8bed # Parent 4bab7c3db4e192ae9dd04dfae04c4939fe6abe4d patch: fix patching with fuzz and eol normalization diff -r 4bab7c3db4e1 -r 3212afb33116 mercurial/patch.py --- 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 diff -r 4bab7c3db4e1 -r 3212afb33116 tests/test-import --- 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) diff -r 4bab7c3db4e1 -r 3212afb33116 tests/test-import.out --- 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