changeset 10884:4fb1bafd43e7

Merge with stable
author Brendan Cully <brendan@kublai.com>
date Sun, 11 Apr 2010 20:59:55 -0700
parents f0bfe42c7b1f (current diff) 196908117c27 (diff)
children 38f2ef9c134b
files mercurial/patch.py tests/test-import.out
diffstat 3 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Apr 09 17:23:37 2010 -0500
+++ b/mercurial/patch.py	Sun Apr 11 20:59:55 2010 -0700
@@ -47,6 +47,9 @@
         if inheader and line[0] in (' ', '\t'):
             # continuation
             return True
+        if line[0] in (' ', '-', '+'):
+            # diff line - don't check for header pattern in there
+            return False
         l = line.split(': ', 1)
         return len(l) == 2 and ' ' not in l[0]
 
--- a/tests/test-import	Fri Apr 09 17:23:37 2010 -0500
+++ b/tests/test-import	Sun Apr 11 20:59:55 2010 -0700
@@ -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 ..
+
--- a/tests/test-import.out	Fri Apr 09 17:23:37 2010 -0500
+++ b/tests/test-import.out	Sun Apr 11 20:59:55 2010 -0700
@@ -373,3 +373,9 @@
 diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
 old mode 100644
 new mode 100755
+% diff lines looking like headers
+adding a
+adding b
+adding c
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+applying patch from stdin