mq: allow lines starting with '--- ' in patch messages stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Thu, 18 Mar 2010 19:26:56 +0100
branchstable
changeset 10730 4d6bd7b8b6d8
parent 10729 7a5931c5f2dc
child 10731 71cf11f03b3d
child 10732 5484f6e17984
mq: allow lines starting with '--- ' in patch messages
hgext/mq.py
tests/test-mq-qimport
--- a/hgext/mq.py	Thu Mar 18 18:22:34 2010 +0100
+++ b/hgext/mq.py	Thu Mar 18 19:26:56 2010 +0100
@@ -96,13 +96,11 @@
 
         for line in file(pf):
             line = line.rstrip()
-            if line.startswith('diff --git'):
+            if (line.startswith('diff --git')
+                or (diffstart and line.startswith('+++ '))):
                 diffstart = 2
                 break
-            if diffstart:
-                if line.startswith('+++ '):
-                    diffstart = 2
-                break
+            diffstart = 0 # reset
             if line.startswith("--- "):
                 diffstart = 1
                 continue
--- a/tests/test-mq-qimport	Thu Mar 18 18:22:34 2010 +0100
+++ b/tests/test-mq-qimport	Thu Mar 18 19:26:56 2010 +0100
@@ -43,6 +43,7 @@
 First line of commit message.
 
 More text in commit message.
+--- confuse the diff detection
 
 diff --git a/x b/x
 new file mode 100644