Mercurial > public > mercurial-scm > hg
diff tests/test-import @ 10883:196908117c27 stable
patch: don't look for headers in diff lines
If you have a diff line that matches a header line, the patch splitter
currently breaks your patch at this line. For example a line like:
+key: value
This can lead to "malformed patch" exceptions. Now fixed.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Fri, 09 Apr 2010 20:34:05 +0200 |
parents | c52057614c72 |
children | f5be44090ba8 |
line wrap: on
line diff
--- a/tests/test-import Fri Apr 09 15:14:43 2010 +0200 +++ b/tests/test-import Fri Apr 09 20:34:05 2010 +0200 @@ -474,3 +474,24 @@ hg sum hg diff --git -c tip cd .. + +echo '% diff lines looking like headers' +hg init difflineslikeheaders +cd difflineslikeheaders +echo a >a +echo b >b +echo c >c +hg ci -Am1 + +echo "key: value" >>a +echo "key: value" >>b +echo "foo" >>c +hg ci -m2 + +hg up -C 0 +hg diff --git -c1 >want +hg diff -c1 | hg import --no-commit - +hg diff --git >have +diff want have +cd .. +