changeset 9288:e668bcd0e25f

Merge with crew-stable
author Martin Geisler <mg@lazybytes.net>
date Sat, 01 Aug 2009 00:36:22 +0200
parents a8fdcec4ab34 (current diff) 53fdf18fd63b (diff)
children 45aaf27f95b8
files hgext/mq.py tests/test-mq-qimport.out
diffstat 3 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri Jul 31 01:40:45 2009 +0200
+++ b/hgext/mq.py	Sat Aug 01 00:36:22 2009 +0200
@@ -105,6 +105,7 @@
                     message.append(line)
                     format = None
             elif line == '# HG changeset patch':
+                message = []
                 format = "hgpatch"
             elif (format != "tagdone" and (line.startswith("Subject: ") or
                                            line.startswith("subject: "))):
--- a/tests/test-mq-qimport	Fri Jul 31 01:40:45 2009 +0200
+++ b/tests/test-mq-qimport	Sat Aug 01 00:36:22 2009 +0200
@@ -27,6 +27,38 @@
 echo % qimport non-existing-file
 hg qimport non-existing-file
 
+echo % import email
+hg qimport --push -n email - <<EOF
+From: Username in email <test@example.net>
+Subject: [PATCH] Message in email
+Date: Fri, 02 Jan 1970 00:00:00 +0000
+
+Text before patch.
+
+# HG changeset patch
+# User Username in patch <test@example.net>
+# Date 0 0
+# Node ID 1a706973a7d84cb549823634a821d9bdf21c6220
+# Parent  0000000000000000000000000000000000000000
+First line of commit message.
+
+More text in commit message.
+
+diff --git a/x b/x
+new file mode 100644
+--- /dev/null
++++ b/x
+@@ -0,0 +1,1 @@
++new file
+Text after patch.
+
+EOF
+
+echo % hg tip -v
+hg tip -v
+hg qpop
+hg qdelete email
+
 echo % import URL
 echo foo >> foo
 hg add foo
--- a/tests/test-mq-qimport.out	Fri Jul 31 01:40:45 2009 +0200
+++ b/tests/test-mq-qimport.out	Sat Aug 01 00:36:22 2009 +0200
@@ -1,5 +1,26 @@
 % qimport non-existing-file
 abort: unable to read non-existing-file
+% import email
+adding email to series file
+applying email
+now at: email
+% hg tip -v
+changeset:   0:1a706973a7d8
+tag:         qtip
+tag:         tip
+tag:         email
+tag:         qbase
+user:        Username in patch <test@example.net>
+date:        Thu Jan 01 00:00:00 1970 +0000
+files:       x
+description:
+First line of commit message.
+
+More text in commit message.
+
+
+popping email
+patch queue now empty
 % import URL
 adding url.diff to series file
 url.diff