[PATCH 3 of 3] tests: combine test-mq-header-(from/date) tests into one test and refactor it

Steve Losh steve at stevelosh.com
Fri Feb 12 19:11:17 CST 2010


# HG changeset patch
# User Steve Losh <steve at stevelosh.com>
# Date 1265763661 18000
# Node ID ff2aa563a25311626a8b40ac4a98d7cec13c5da7
# Parent  3c1eee3d90378bde9502bb2f7098f97bc67be6a9
tests: combine test-mq-header-(from/date) tests into one test and refactor it

This patch combines test-mq-header-from and test-mq-header-date into a single
test-mq-headers file.

It also refactors everything to provide much more comprehensive test coverage
of possible header combinations, at the cost of increasing the time needed to
run.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2771,10 +2771,11 @@
     "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
     "qunapplied":
         (unapplied,
          [('1', 'first', None, _('show only the first patch'))] + seriesopts,
          _('hg qunapplied [-1] [-s] [PATCH]')),
     "qfinish":
         (finish,
          [('a', 'applied', None, _('finish all applied changesets'))],
          _('hg qfinish [-a] [REV]...')),
 }
+" "
\ No newline at end of file
diff --git a/tests/test-mq-header-date.out b/tests/test-mq-header-date.out
deleted file mode 100644
--- a/tests/test-mq-header-date.out
+++ /dev/null
@@ -1,704 +0,0 @@
-======= plain headers
-==== init
-==== qnew -d
-Date: 3 0
-
-0: [mq]: 1.patch - test - 3.00
-==== qref
-adding 1
-Date: 3 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 3.00
-==== qref -d
-Date: 4 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 2
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-==== qref -d
-Date: 5 0
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-popping 2.patch
-now at: 1.patch
-==== qnew -d -m
-Date: 6 0
-
-Three
-
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref
-adding 3
-Date: 6 0
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -m
-Date: 6 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d
-Date: 7 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 7.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d -m
-Date: 8 0
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew -m
-adding 4
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-Date: 9 0
-
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 4.patch
-now at: 3.patch
-==== qnew with HG header
-popping 5.patch
-now at: 3.patch
-# HG changeset patch
-# Date 10 0
-2: imported patch 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref
-adding 5
-# HG changeset patch
-# Date 10 0
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-# HG changeset patch
-# Date 11 0
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-Date: 12 0
-
-3: imported patch 6.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== hg qref
-adding 6
-Date: 12 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 12.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-Date: 13 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-popping 6.patch
-now at: 5.patch
-==== qnew -u
-adding 6
-From: jane
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-From: jane
-Date: 12 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 6.patch
-now at: 5.patch
-==== qnew -d
-adding 7
-Date: 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u
-From: john
-Date: 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - john - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 8
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-From: john
-Date: 14 0
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 8.patch
-now at: 7.patch
-==== qnew -m
-adding 9
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-From: john
-Date: 15 0
-
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 9.patch
-now at: 7.patch
-==== qpop -a / qpush -a
-popping 7.patch
-popping 5.patch
-popping 3.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 3.patch
-applying 5.patch
-applying 7.patch
-now at: 7.patch
-3: imported patch 7.patch - john - 13.00
-2: imported patch 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: imported patch 1.patch - test - 4.00
-======= hg headers
-==== init
-==== qnew -d
-# HG changeset patch
-# Date 3 0
-# Parent 
-
-0: [mq]: 1.patch - test - 3.00
-==== qref
-adding 1
-# HG changeset patch
-# Date 3 0
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 3.00
-==== qref -d
-# HG changeset patch
-# Date 4 0
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# Date 5 0
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-popping 2.patch
-now at: 1.patch
-==== qnew -d -m
-# HG changeset patch
-# Date 6 0
-# Parent 
-
-Three
-
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref
-adding 3
-# HG changeset patch
-# Date 6 0
-# Parent 
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -m
-# HG changeset patch
-# Date 6 0
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d
-# HG changeset patch
-# Date 7 0
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 7.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d -m
-# HG changeset patch
-# Date 8 0
-# Parent 
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew -m
-adding 4
-# HG changeset patch
-# Parent 
-
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# Date 9 0
-# Parent 
-
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 4.patch
-now at: 3.patch
-==== qnew with HG header
-popping 5.patch
-now at: 3.patch
-# HG changeset patch
-# Date 10 0
-2: imported patch 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref
-adding 5
-# HG changeset patch
-# Date 10 0
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-# HG changeset patch
-# Date 11 0
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-Date: 12 0
-
-3: imported patch 6.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== hg qref
-adding 6
-Date: 12 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 12.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-Date: 13 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-popping 6.patch
-now at: 5.patch
-==== qnew -u
-adding 6
-# HG changeset patch
-# User jane
-# Parent 
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# User jane
-# Date 12 0
-# Parent 
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 6.patch
-now at: 5.patch
-==== qnew -d
-adding 7
-# HG changeset patch
-# Date 13 0
-# Parent 
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# User john
-# Date 13 0
-# Parent 
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - john - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 8
-# HG changeset patch
-# Parent 
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-# HG changeset patch
-# User john
-# Date 14 0
-# Parent 
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 8.patch
-now at: 7.patch
-==== qnew -m
-adding 9
-# HG changeset patch
-# Parent 
-
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-# HG changeset patch
-# User john
-# Date 15 0
-# Parent 
-
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 9.patch
-now at: 7.patch
-==== qpop -a / qpush -a
-popping 7.patch
-popping 5.patch
-popping 3.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 3.patch
-applying 5.patch
-applying 7.patch
-now at: 7.patch
-3: imported patch 7.patch - john - 13.00
-2: imported patch 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: imported patch 1.patch - test - 4.00
diff --git a/tests/test-mq-header-from b/tests/test-mq-header-from
deleted file mode 100755
--- a/tests/test-mq-header-from
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=true" >> $HGRCPATH
-
-
-catlog() {
-    cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
-                                   -e "s/^\(# Parent \).*/\1/"
-    hg log --template "{rev}: {desc} - {author}\n"
-}
-
-runtest() {
-    echo ==== init
-    hg init a
-    cd a
-    hg qinit
-
-
-    echo ==== qnew -U
-    hg qnew -U 1.patch
-    catlog 1
-
-    echo ==== qref
-    echo "1" >1
-    hg add
-    hg qref
-    catlog 1
-
-    echo ==== qref -u
-    hg qref -u mary
-    catlog 1
-
-    echo ==== qnew
-    hg qnew 2.patch
-    echo "2" >2
-    hg add
-    hg qref
-    catlog 2
-
-    echo ==== qref -u
-    hg qref -u jane
-    catlog 2
-
-
-    echo ==== qnew -U -m
-    hg qnew -U -m "Three" 3.patch
-    catlog 3
-
-    echo ==== qref
-    echo "3" >3
-    hg add
-    hg qref
-    catlog 3
-
-    echo ==== qref -m
-    hg qref -m "Drei"
-    catlog 3
-
-    echo ==== qref -u
-    hg qref -u mary
-    catlog 3
-
-    echo ==== qref -u -m
-    hg qref -u maria -m "Three (again)"
-    catlog 3
-
-    echo ==== qnew -m
-    hg qnew -m "Four" 4.patch
-    echo "4" >4of t
-    hg add
-    hg qref
-    catlog 4
-
-    echo ==== qref -u
-    hg qref -u jane
-    catlog 4
-
-
-    echo ==== qnew with HG header
-    hg qnew --config 'mq.plain=true' 5.patch
-    hg qpop
-    echo "# HG changeset patch" >>.hg/patches/5.patch
-    echo "# User johndoe" >>.hg/patches/5.patch
-    hg qpush 2>&1 | grep 'now at'
-    catlog 5
-
-    echo ==== hg qref
-    echo "5" >5
-    hg add
-    hg qref
-    catlog 5
-
-    echo ==== hg qref -U
-    hg qref -U
-    catlog 5
-
-    echo ==== hg qref -u
-    hg qref -u johndeere
-    catlog 5
-
-
-    echo ==== qnew with plain header
-    hg qnew --config 'mq.plain=true' -U 6.patch
-    hg qpop
-    hg qpush 2>&1 | grep 'now at'
-    catlog 6
-
-    echo ==== hg qref
-    echo "6" >6
-    hg add
-    hg qref
-    catlog 6
-
-    echo ==== hg qref -U
-    hg qref -U
-    catlog 6
-
-    echo ==== hg qref -u
-    hg qref -u johndeere
-    catlog 6
-
-
-    echo ==== "qpop -a / qpush -a"
-    hg qpop -a
-    hg qpush -a
-    hg log --template "{rev}: {desc} - {author}\n"
-}
-
-
-echo ======= plain headers
-
-echo "[mq]" >> $HGRCPATH
-echo "plain=true" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-
-echo ======= hg headers
-
-echo "plain=false" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-runtest
diff --git a/tests/test-mq-header-from.out b/tests/test-mq-header-from.out
deleted file mode 100644
--- a/tests/test-mq-header-from.out
+++ /dev/null
@@ -1,846 +0,0 @@
-======= plain headers
-==== init
-==== qnew -U
-From: test
-
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-From: test
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-From: mary
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-From: jane
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-From: test
-
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-From: test
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-From: test
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-From: mary
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-From: maria
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-From: jane
-
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# User johndoe
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# User test
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# User johndeere
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
-======= hg headers
-==== init
-==== qnew -U
-# HG changeset patch
-# User test
-# Parent 
-
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-# HG changeset patch
-# User test
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# User mary
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-# HG changeset patch
-# User test
-# Parent 
-
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-# HG changeset patch
-# User test
-# Parent 
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-# HG changeset patch
-# User test
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User mary
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-# HG changeset patch
-# User maria
-# Parent 
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-# HG changeset patch
-# Parent 
-
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# User johndoe
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# User test
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# User johndeere
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
-==== init
-==== qnew -U
-# HG changeset patch
-# User test
-# Parent 
-
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-# HG changeset patch
-# User test
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# User mary
-# Parent 
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-# HG changeset patch
-# User test
-# Parent 
-
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-# HG changeset patch
-# User test
-# Parent 
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-# HG changeset patch
-# User test
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User mary
-# Parent 
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-# HG changeset patch
-# User maria
-# Parent 
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-# HG changeset patch
-# Parent 
-
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# User johndoe
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# User test
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# User johndeere
-# Parent 
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
diff --git a/tests/test-mq-header-date b/tests/test-mq-headers
rename from tests/test-mq-header-date
rename to tests/test-mq-headers
--- a/tests/test-mq-header-date
+++ b/tests/test-mq-headers
@@ -6,212 +6,241 @@
 echo "nodates=true" >> $HGRCPATH
 
 
 catpatch() {
     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
                                    -e "s/^\(# Parent \).*/\1/"
 }
 
 catlog() {
     catpatch $1
-    hg log --template "{rev}: {desc} - {author}\n"
+    hg log -r tip --template "{rev}: {desc} - {author}\n"
 }
 
 catlogd() {
     catpatch $1
-    hg log --template "{rev}: {desc} - {author} - {date}\n"
+    hg log -r tip --template "{rev}: {desc} - {author} - {date}\n"
 }
 
-drop() {
-    hg qpop
-    hg qdel $1.patch
+qnew() {
+    echo '==== qnew'
+    hg qnew `echo $2` $1.patch
+}
+qnew_empty() {
+    echo '==== qnew'
+    hg qnew --config 'mq.plain=true' $1.patch
+}
+qnew_hg() {
+    qnew_empty $1
+    hg qpop >/dev/null 2>&1
+    echo "# HG changeset patch" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_hg_d() {
+    qnew_hg $1
+    hg qpop >/dev/null 2>&1
+    echo "# Date 10 0" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_hg_u() {
+    qnew_hg $1
+    hg qpop >/dev/null 2>&1
+    echo "# User hguser" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_hg_ud() {
+    qnew_hg $1
+    hg qpop >/dev/null 2>&1
+    echo '==== writing HG user and date headers'
+    echo "# User hguser" >>.hg/patches/$1.patch
+    echo "# Date 10 0" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_plain() {
+    qnew_empty $1
+}
+qnew_plain_d() {
+    qnew_plain $1
+    hg qpop >/dev/null 2>&1
+    echo "Date: 10 0" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_plain_u() {
+    qnew_plain $1
+    hg qpop >/dev/null 2>&1
+    echo "From: plainuser" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
+}
+qnew_plain_ud() {
+    qnew_plain $1
+    hg qpop >/dev/null 2>&1
+    echo "From: plainuser" >>.hg/patches/$1.patch
+    echo "Date: 10 0" >>.hg/patches/$1.patch
+    hg qpush >/dev/null 2>&1
 }
 
+qref_c() {
+    $2 $1 "$3"
+    catlog $1
+    
+    echo '==== qref'
+    echo "content for $1" >$1
+    hg add >/dev/null
+    hg qref
+    catlog $1
+}
+qref_d_u() {
+    $2 $1 "$3"
+
+    echo '==== qref -d'
+    hg qref -d '4 0'
+    catlogd $1
+
+    echo '==== qref -u'
+    hg qref -u john
+    catlogd $1
+}
+qref_u_d() {
+    $2 $1 "$3"
+
+    echo '==== qref -u'
+    hg qref -u john
+    catlog $1
+
+    echo '==== qref -d'
+    hg qref -d '4 0'
+    catlogd $1
+}
+qref_ud() {
+    $2 $1 "$3"
+
+    echo '==== qref -u -d'
+    hg qref -u john -d '4 0'
+    catlogd $1
+}
+qref_U_u_U() {
+    $2 $1 "$3"
+
+    echo '==== qref -U'
+    hg qref -U
+    catlog $1
+
+    echo '==== qref -u'
+    hg qref -u john
+    catlog $1
+
+    echo '==== qref -U'
+    hg qref -U
+    catlog $1
+}
+
+# 3 arguments: patch name, qnew function to use, arguments to qnew
 runtest() {
-    echo ==== init
+    qref_c a$1 $2 "$3"
+    qref_d_u b$1 $2 "$3"
+    qref_u_d c$1 $2 "$3"
+    qref_ud d$1 $2 "$3"
+    qref_U_u_U e$1 $2 "$3"
+}
+
+runtests() {
     hg init a
     cd a
     hg qinit
 
-
-    echo ==== qnew -d
-    hg qnew -d '3 0' 1.patch
-    catlogd 1
-
-    echo ==== qref
-    echo "1" >1
-    hg add
-    hg qref
-    catlogd 1
-
-    echo ==== qref -d
-    hg qref -d '4 0'
-    catlogd 1
-
-
-    echo ==== qnew
-    hg qnew 2.patch
-    echo "2" >2
-    hg add
-    hg qref
-    catlog 2
-
-    echo ==== qref -d
-    hg qref -d '5 0'
-    catlog 2
-
-    drop 2
-
-
-    echo ==== qnew -d -m
-    hg qnew -d '6 0' -m "Three" 3.patch
-    catlogd 3
-
-    echo ==== qref
-    echo "3" >3
-    hg add
-    hg qref
-    catlogd 3
-
-    echo ==== qref -m
-    hg qref -m "Drei"
-    catlogd 3
-
-    echo ==== qref -d
-    hg qref -d '7 0'
-    catlogd 3
-
-    echo ==== qref -d -m
-    hg qref -d '8 0' -m "Three (again)"
-    catlogd 3
-
-
-    echo ==== qnew -m
-    hg qnew -m "Four" 4.patch
-    echo "4" >4
-    hg add
-    hg qref
-    catlog 4
-
-    echo ==== qref -d
-    hg qref -d '9 0'
-    catlog 4
-
-    drop 4
-
-
-    echo ==== qnew with HG header
-    hg qnew --config 'mq.plain=true' 5.patch
-    hg qpop
-    echo "# HG changeset patch" >>.hg/patches/5.patch
-    echo "# Date 10 0" >>.hg/patches/5.patch
-    hg qpush 2>&1 | grep 'Now at'
-    catlogd 5
-
-    echo ==== hg qref
-    echo "5" >5
-    hg add
-    hg qref
-    catlogd 5
-
-    echo ==== hg qref -d
-    hg qref -d '11 0'
-    catlogd 5
-
-
-    echo ==== qnew with plain header
-    hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
-    hg qpop
-    hg qpush 2>&1 | grep 'now at'
-    catlog 6
-
-    echo ==== hg qref
-    echo "6" >6
-    hg add
-    hg qref
-    catlogd 6
-
-    echo ==== hg qref -d
-    hg qref -d '13 0'
-    catlogd 6
-
-    drop 6
+    echo
+    echo '======== Patches with no specific header'
+    runtest 1 'qnew' ' '
     
-
-    echo ==== qnew -u
-    hg qnew -u jane 6.patch
-    echo "6" >6
-    hg add
-    hg qref
-    catlog 6
-
-    echo ==== qref -d
-    hg qref -d '12 0'
-    catlog 6
-
-    drop 6
-
-
-    echo ==== qnew -d
-    hg qnew -d '13 0' 7.patch
-    echo "7" >7
-    hg add
-    hg qref
-    catlog 7
-
-    echo ==== qref -u
-    hg qref -u john
-    catlogd 7
-
-
-    echo ==== qnew
-    hg qnew 8.patch
-    echo "8" >8
-    hg add
-    hg qref
-    catlog 8
-
-    echo ==== qref -u -d
-    hg qref -u john -d '14 0'
-    catlog 8
-
-    drop 8
-
-
-    echo ==== qnew -m
-    hg qnew -m "Nine" 9.patch
-    echo "9" >9
-    hg add
-    hg qref
-    catlog 9
-
-    echo ==== qref -u -d
-    hg qref -u john -d '15 0'
-    catlog 9
-
-    drop 9
-
-
-    echo ==== "qpop -a / qpush -a"
-    hg qpop -a
-    hg qpush -a
-    hg log --template "{rev}: {desc} - {author} - {date}\n"
+    echo
+    echo '======== Patches with a date header'
+    runtest 2 'qnew' '-d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a (specific) user header'
+    runtest 3 'qnew' '-u origuser'
+    
+    echo
+    echo '======== Patches with a (current) user header'
+    runtest 4 'qnew' '-U'
+    
+    echo
+    echo '======== Patches with a (specific) user and date header'
+    runtest 5 'qnew' '-u origuser -d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a (current) user and date header'
+    runtest 6 'qnew' '-U -d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a message'
+    runtest 7 'qnew' '-m testmessage'
+    
+    echo
+    echo '======== Patches with a message and (specific) user header'
+    runtest 8 'qnew' '-m testmessage -u origuser'
+    
+    echo
+    echo '======== Patches with a message and (current) user header'
+    runtest 9 'qnew' '-m testmessage -U'
+    
+    echo
+    echo '======== Patches with a message and date header'
+    runtest 10 'qnew' '-m testmessage -d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a message and (specific) user and date header'
+    runtest 11 'qnew' '-m testmessage -u origuser -d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a message and (current) user and date header'
+    runtest 12 'qnew' '-m testmessage -U -d 2010-2-2'
+    
+    echo
+    echo '======== Patches with a forced HG header'
+    runtest 13 'qnew_hg' ' '
+    
+    echo
+    echo '======== Patches with a forced HG header including user'
+    runtest 14 'qnew_hg_u' ' '
+    
+    echo
+    echo '======== Patches with a forced HG header including date'
+    runtest 15 'qnew_hg_d' ' '
+    
+    echo
+    echo '======== Patches with a forced HG header including user and date'
+    runtest 16 'qnew_hg_ud' ' '
+    
+    echo
+    echo '======== Patches with a forced plain header'
+    runtest 17 'qnew_plain' ' '
+    
+    echo
+    echo '======== Patches with a forced plain header including user'
+    runtest 18 'qnew_plain_u' ' '
+    
+    echo
+    echo '======== Patches with a forced plain header including date'
+    runtest 19 'qnew_plain_d' ' '
+    
+    echo
+    echo '======== Patches with a forced plain header including user and date'
+    runtest 20 'qnew_plain_ud' ' '
 }
 
 
-echo ======= plain headers
+echo '============ Testing plain headers'
 
 echo "[mq]" >> $HGRCPATH
 echo "plain=true" >> $HGRCPATH
+mkdir sandboxplain
+(cd sandboxplain ; runtests)
 
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
+echo
+echo
 
-
-echo ======= hg headers
+echo '============ Testing HG headers'
 
 echo "plain=false" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
+mkdir sandboxhg
+(cd sandboxhg ; runtests)
diff --git a/tests/test-mq-headers.out b/tests/test-mq-headers.out
new file mode 100644
--- /dev/null
+++ b/tests/test-mq-headers.out
@@ -0,0 +1,2915 @@
+============ Testing plain headers
+
+======== Patches with no specific header
+==== qnew
+0: [mq]: a1.patch - test
+==== qref
+diff -r ... a1
+--- /dev/null
++++ b/a1
+@@ -0,0 +1,1 @@
++content for a1
+0: [mq]: a1.patch - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+1: [mq]: b1.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+1: [mq]: b1.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+2: [mq]: c1.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+2: [mq]: c1.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+3: [mq]: d1.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+4: [mq]: e1.patch - test
+==== qref -u
+From: john
+
+4: [mq]: e1.patch - john
+==== qref -U
+From: test
+
+4: [mq]: e1.patch - test
+
+======== Patches with a date header
+==== qnew
+Date: 1265068800 0
+
+5: [mq]: a2.patch - test
+==== qref
+Date: 1265068800 0
+
+diff -r ... a2
+--- /dev/null
++++ b/a2
+@@ -0,0 +1,1 @@
++content for a2
+5: [mq]: a2.patch - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+6: [mq]: b2.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+6: [mq]: b2.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+7: [mq]: c2.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+7: [mq]: c2.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+8: [mq]: d2.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+9: [mq]: e2.patch - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+9: [mq]: e2.patch - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+9: [mq]: e2.patch - test
+
+======== Patches with a (specific) user header
+==== qnew
+From: origuser
+
+10: [mq]: a3.patch - origuser
+==== qref
+From: origuser
+
+diff -r ... a3
+--- /dev/null
++++ b/a3
+@@ -0,0 +1,1 @@
++content for a3
+10: [mq]: a3.patch - origuser
+==== qnew
+==== qref -d
+From: origuser
+Date: 4 0
+
+11: [mq]: b3.patch - origuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+11: [mq]: b3.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+12: [mq]: c3.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+12: [mq]: c3.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+13: [mq]: d3.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+14: [mq]: e3.patch - test
+==== qref -u
+From: john
+
+14: [mq]: e3.patch - john
+==== qref -U
+From: test
+
+14: [mq]: e3.patch - test
+
+======== Patches with a (current) user header
+==== qnew
+From: test
+
+15: [mq]: a4.patch - test
+==== qref
+From: test
+
+diff -r ... a4
+--- /dev/null
++++ b/a4
+@@ -0,0 +1,1 @@
++content for a4
+15: [mq]: a4.patch - test
+==== qnew
+==== qref -d
+From: test
+Date: 4 0
+
+16: [mq]: b4.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+16: [mq]: b4.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+17: [mq]: c4.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+17: [mq]: c4.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+18: [mq]: d4.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+19: [mq]: e4.patch - test
+==== qref -u
+From: john
+
+19: [mq]: e4.patch - john
+==== qref -U
+From: test
+
+19: [mq]: e4.patch - test
+
+======== Patches with a (specific) user and date header
+==== qnew
+From: origuser
+Date: 1265068800 0
+
+20: [mq]: a5.patch - origuser
+==== qref
+From: origuser
+Date: 1265068800 0
+
+diff -r ... a5
+--- /dev/null
++++ b/a5
+@@ -0,0 +1,1 @@
++content for a5
+20: [mq]: a5.patch - origuser
+==== qnew
+==== qref -d
+From: origuser
+Date: 4 0
+
+21: [mq]: b5.patch - origuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+21: [mq]: b5.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+22: [mq]: c5.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+22: [mq]: c5.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+23: [mq]: d5.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+24: [mq]: e5.patch - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+24: [mq]: e5.patch - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+24: [mq]: e5.patch - test
+
+======== Patches with a (current) user and date header
+==== qnew
+From: test
+Date: 1265068800 0
+
+25: [mq]: a6.patch - test
+==== qref
+From: test
+Date: 1265068800 0
+
+diff -r ... a6
+--- /dev/null
++++ b/a6
+@@ -0,0 +1,1 @@
++content for a6
+25: [mq]: a6.patch - test
+==== qnew
+==== qref -d
+From: test
+Date: 4 0
+
+26: [mq]: b6.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+26: [mq]: b6.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+27: [mq]: c6.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+27: [mq]: c6.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+28: [mq]: d6.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+29: [mq]: e6.patch - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+29: [mq]: e6.patch - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+29: [mq]: e6.patch - test
+
+======== Patches with a message
+==== qnew
+testmessage
+
+30: testmessage - test
+==== qref
+testmessage
+
+diff -r ... a7
+--- /dev/null
++++ b/a7
+@@ -0,0 +1,1 @@
++content for a7
+30: testmessage - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+testmessage
+
+31: testmessage - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+31: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+testmessage
+
+32: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+32: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+33: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+testmessage
+
+34: testmessage - test
+==== qref -u
+From: john
+
+testmessage
+
+34: testmessage - john
+==== qref -U
+From: test
+
+testmessage
+
+34: testmessage - test
+
+======== Patches with a message and (specific) user header
+==== qnew
+From: origuser
+
+testmessage
+
+35: testmessage - origuser
+==== qref
+From: origuser
+
+testmessage
+
+diff -r ... a8
+--- /dev/null
++++ b/a8
+@@ -0,0 +1,1 @@
++content for a8
+35: testmessage - origuser
+==== qnew
+==== qref -d
+From: origuser
+Date: 4 0
+
+testmessage
+
+36: testmessage - origuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+36: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+testmessage
+
+37: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+37: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+38: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+testmessage
+
+39: testmessage - test
+==== qref -u
+From: john
+
+testmessage
+
+39: testmessage - john
+==== qref -U
+From: test
+
+testmessage
+
+39: testmessage - test
+
+======== Patches with a message and (current) user header
+==== qnew
+From: test
+
+testmessage
+
+40: testmessage - test
+==== qref
+From: test
+
+testmessage
+
+diff -r ... a9
+--- /dev/null
++++ b/a9
+@@ -0,0 +1,1 @@
++content for a9
+40: testmessage - test
+==== qnew
+==== qref -d
+From: test
+Date: 4 0
+
+testmessage
+
+41: testmessage - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+41: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+testmessage
+
+42: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+42: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+43: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+testmessage
+
+44: testmessage - test
+==== qref -u
+From: john
+
+testmessage
+
+44: testmessage - john
+==== qref -U
+From: test
+
+testmessage
+
+44: testmessage - test
+
+======== Patches with a message and date header
+==== qnew
+Date: 1265068800 0
+
+testmessage
+
+45: testmessage - test
+==== qref
+Date: 1265068800 0
+
+testmessage
+
+diff -r ... a10
+--- /dev/null
++++ b/a10
+@@ -0,0 +1,1 @@
++content for a10
+45: testmessage - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+testmessage
+
+46: testmessage - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+46: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+47: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+47: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+48: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+49: testmessage - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+49: testmessage - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+49: testmessage - test
+
+======== Patches with a message and (specific) user and date header
+==== qnew
+From: origuser
+Date: 1265068800 0
+
+testmessage
+
+50: testmessage - origuser
+==== qref
+From: origuser
+Date: 1265068800 0
+
+testmessage
+
+diff -r ... a11
+--- /dev/null
++++ b/a11
+@@ -0,0 +1,1 @@
++content for a11
+50: testmessage - origuser
+==== qnew
+==== qref -d
+From: origuser
+Date: 4 0
+
+testmessage
+
+51: testmessage - origuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+51: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+52: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+52: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+53: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+54: testmessage - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+54: testmessage - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+54: testmessage - test
+
+======== Patches with a message and (current) user and date header
+==== qnew
+From: test
+Date: 1265068800 0
+
+testmessage
+
+55: testmessage - test
+==== qref
+From: test
+Date: 1265068800 0
+
+testmessage
+
+diff -r ... a12
+--- /dev/null
++++ b/a12
+@@ -0,0 +1,1 @@
++content for a12
+55: testmessage - test
+==== qnew
+==== qref -d
+From: test
+Date: 4 0
+
+testmessage
+
+56: testmessage - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+testmessage
+
+56: testmessage - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+57: testmessage - john
+==== qref -d
+From: john
+Date: 4 0
+
+testmessage
+
+57: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+testmessage
+
+58: testmessage - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+59: testmessage - test
+==== qref -u
+From: john
+Date: 1265068800 0
+
+testmessage
+
+59: testmessage - john
+==== qref -U
+From: test
+Date: 1265068800 0
+
+testmessage
+
+59: testmessage - test
+
+======== Patches with a forced HG header
+==== qnew
+# HG changeset patch
+60: imported patch a13.patch - test
+==== qref
+# HG changeset patch
+# Parent 
+
+diff -r ... a13
+--- /dev/null
++++ b/a13
+@@ -0,0 +1,1 @@
++content for a13
+60: [mq]: a13.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+61: [mq]: b13.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+61: [mq]: b13.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+62: [mq]: c13.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+62: [mq]: c13.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+63: [mq]: d13.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+64: [mq]: e13.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+64: [mq]: e13.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+64: [mq]: e13.patch - test
+
+======== Patches with a forced HG header including user
+==== qnew
+# HG changeset patch
+# User hguser
+65: imported patch a14.patch - hguser
+==== qref
+# HG changeset patch
+# User hguser
+# Parent 
+
+diff -r ... a14
+--- /dev/null
++++ b/a14
+@@ -0,0 +1,1 @@
++content for a14
+65: [mq]: a14.patch - hguser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User hguser
+# Date 4 0
+# Parent 
+
+66: [mq]: b14.patch - hguser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+66: [mq]: b14.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+67: [mq]: c14.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+67: [mq]: c14.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+68: [mq]: d14.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+69: [mq]: e14.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+69: [mq]: e14.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+69: [mq]: e14.patch - test
+
+======== Patches with a forced HG header including date
+==== qnew
+# HG changeset patch
+# Date 10 0
+70: imported patch a15.patch - test
+==== qref
+# HG changeset patch
+# Date 10 0
+# Parent 
+
+diff -r ... a15
+--- /dev/null
++++ b/a15
+@@ -0,0 +1,1 @@
++content for a15
+70: [mq]: a15.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+71: [mq]: b15.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+71: [mq]: b15.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+72: [mq]: c15.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+72: [mq]: c15.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+73: [mq]: d15.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - test
+
+======== Patches with a forced HG header including user and date
+==== qnew
+==== writing HG user and date headers
+# HG changeset patch
+# User hguser
+# Date 10 0
+75: imported patch a16.patch - hguser
+==== qref
+# HG changeset patch
+# User hguser
+# Date 10 0
+# Parent 
+
+diff -r ... a16
+--- /dev/null
++++ b/a16
+@@ -0,0 +1,1 @@
++content for a16
+75: [mq]: a16.patch - hguser
+==== qnew
+==== writing HG user and date headers
+==== qref -d
+# HG changeset patch
+# User hguser
+# Date 4 0
+# Parent 
+
+76: [mq]: b16.patch - hguser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+76: [mq]: b16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+77: [mq]: c16.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+77: [mq]: c16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+78: [mq]: d16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - test
+
+======== Patches with a forced plain header
+==== qnew
+80: [mq]: a17.patch - test
+==== qref
+diff -r ... a17
+--- /dev/null
++++ b/a17
+@@ -0,0 +1,1 @@
++content for a17
+80: [mq]: a17.patch - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+81: [mq]: b17.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+81: [mq]: b17.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+82: [mq]: c17.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+82: [mq]: c17.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+83: [mq]: d17.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+84: [mq]: e17.patch - test
+==== qref -u
+From: john
+
+84: [mq]: e17.patch - john
+==== qref -U
+From: test
+
+84: [mq]: e17.patch - test
+
+======== Patches with a forced plain header including user
+==== qnew
+From: plainuser
+85: imported patch a18.patch - plainuser
+==== qref
+From: plainuser
+
+diff -r ... a18
+--- /dev/null
++++ b/a18
+@@ -0,0 +1,1 @@
++content for a18
+85: [mq]: a18.patch - plainuser
+==== qnew
+==== qref -d
+From: plainuser
+Date: 4 0
+
+86: [mq]: b18.patch - plainuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+86: [mq]: b18.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+87: [mq]: c18.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+87: [mq]: c18.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+88: [mq]: d18.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+89: [mq]: e18.patch - test
+==== qref -u
+From: john
+
+89: [mq]: e18.patch - john
+==== qref -U
+From: test
+
+89: [mq]: e18.patch - test
+
+======== Patches with a forced plain header including date
+==== qnew
+Date: 10 0
+90: imported patch a19.patch - test
+==== qref
+Date: 10 0
+
+diff -r ... a19
+--- /dev/null
++++ b/a19
+@@ -0,0 +1,1 @@
++content for a19
+90: [mq]: a19.patch - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+91: [mq]: b19.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+91: [mq]: b19.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 10 0
+
+92: [mq]: c19.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+92: [mq]: c19.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+93: [mq]: d19.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 10 0
+
+94: [mq]: e19.patch - test
+==== qref -u
+From: john
+Date: 10 0
+
+94: [mq]: e19.patch - john
+==== qref -U
+From: test
+Date: 10 0
+
+94: [mq]: e19.patch - test
+
+======== Patches with a forced plain header including user and date
+==== qnew
+From: plainuser
+Date: 10 0
+95: imported patch a20.patch - plainuser
+==== qref
+From: plainuser
+Date: 10 0
+
+diff -r ... a20
+--- /dev/null
++++ b/a20
+@@ -0,0 +1,1 @@
++content for a20
+95: [mq]: a20.patch - plainuser
+==== qnew
+==== qref -d
+From: plainuser
+Date: 4 0
+
+96: [mq]: b20.patch - plainuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+96: [mq]: b20.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 10 0
+
+97: [mq]: c20.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+97: [mq]: c20.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+98: [mq]: d20.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 10 0
+
+99: [mq]: e20.patch - test
+==== qref -u
+From: john
+Date: 10 0
+
+99: [mq]: e20.patch - john
+==== qref -U
+From: test
+Date: 10 0
+
+99: [mq]: e20.patch - test
+
+
+============ Testing HG headers
+
+======== Patches with no specific header
+==== qnew
+# HG changeset patch
+# Parent 
+
+0: [mq]: a1.patch - test
+==== qref
+# HG changeset patch
+# Parent 
+
+diff -r ... a1
+--- /dev/null
++++ b/a1
+@@ -0,0 +1,1 @@
++content for a1
+0: [mq]: a1.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+1: [mq]: b1.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+1: [mq]: b1.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+2: [mq]: c1.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+2: [mq]: c1.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+3: [mq]: d1.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+4: [mq]: e1.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+4: [mq]: e1.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+4: [mq]: e1.patch - test
+
+======== Patches with a date header
+==== qnew
+# HG changeset patch
+# Date 1265068800 0
+# Parent 
+
+5: [mq]: a2.patch - test
+==== qref
+# HG changeset patch
+# Date 1265068800 0
+# Parent 
+
+diff -r ... a2
+--- /dev/null
++++ b/a2
+@@ -0,0 +1,1 @@
++content for a2
+5: [mq]: a2.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+6: [mq]: b2.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+6: [mq]: b2.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+7: [mq]: c2.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+7: [mq]: c2.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+8: [mq]: d2.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+9: [mq]: e2.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+9: [mq]: e2.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+9: [mq]: e2.patch - test
+
+======== Patches with a (specific) user header
+==== qnew
+# HG changeset patch
+# User origuser
+# Parent 
+
+10: [mq]: a3.patch - origuser
+==== qref
+# HG changeset patch
+# User origuser
+# Parent 
+
+diff -r ... a3
+--- /dev/null
++++ b/a3
+@@ -0,0 +1,1 @@
++content for a3
+10: [mq]: a3.patch - origuser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User origuser
+# Date 4 0
+# Parent 
+
+11: [mq]: b3.patch - origuser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+11: [mq]: b3.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+12: [mq]: c3.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+12: [mq]: c3.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+13: [mq]: d3.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+14: [mq]: e3.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+14: [mq]: e3.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+14: [mq]: e3.patch - test
+
+======== Patches with a (current) user header
+==== qnew
+# HG changeset patch
+# User test
+# Parent 
+
+15: [mq]: a4.patch - test
+==== qref
+# HG changeset patch
+# User test
+# Parent 
+
+diff -r ... a4
+--- /dev/null
++++ b/a4
+@@ -0,0 +1,1 @@
++content for a4
+15: [mq]: a4.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# User test
+# Date 4 0
+# Parent 
+
+16: [mq]: b4.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+16: [mq]: b4.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+17: [mq]: c4.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+17: [mq]: c4.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+18: [mq]: d4.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+19: [mq]: e4.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+19: [mq]: e4.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+19: [mq]: e4.patch - test
+
+======== Patches with a (specific) user and date header
+==== qnew
+# HG changeset patch
+# User origuser
+# Date 1265068800 0
+# Parent 
+
+20: [mq]: a5.patch - origuser
+==== qref
+# HG changeset patch
+# User origuser
+# Date 1265068800 0
+# Parent 
+
+diff -r ... a5
+--- /dev/null
++++ b/a5
+@@ -0,0 +1,1 @@
++content for a5
+20: [mq]: a5.patch - origuser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User origuser
+# Date 4 0
+# Parent 
+
+21: [mq]: b5.patch - origuser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+21: [mq]: b5.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+22: [mq]: c5.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+22: [mq]: c5.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+23: [mq]: d5.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+24: [mq]: e5.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+24: [mq]: e5.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+24: [mq]: e5.patch - test
+
+======== Patches with a (current) user and date header
+==== qnew
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+25: [mq]: a6.patch - test
+==== qref
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+diff -r ... a6
+--- /dev/null
++++ b/a6
+@@ -0,0 +1,1 @@
++content for a6
+25: [mq]: a6.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# User test
+# Date 4 0
+# Parent 
+
+26: [mq]: b6.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+26: [mq]: b6.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+27: [mq]: c6.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+27: [mq]: c6.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+28: [mq]: d6.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+29: [mq]: e6.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+29: [mq]: e6.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+29: [mq]: e6.patch - test
+
+======== Patches with a message
+==== qnew
+# HG changeset patch
+# Parent 
+
+testmessage
+
+30: testmessage - test
+==== qref
+# HG changeset patch
+# Parent 
+
+testmessage
+
+diff -r ... a7
+--- /dev/null
++++ b/a7
+@@ -0,0 +1,1 @@
++content for a7
+30: testmessage - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+testmessage
+
+31: testmessage - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+31: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+32: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+32: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+33: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+34: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+34: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+34: testmessage - test
+
+======== Patches with a message and (specific) user header
+==== qnew
+# HG changeset patch
+# User origuser
+# Parent 
+
+testmessage
+
+35: testmessage - origuser
+==== qref
+# HG changeset patch
+# User origuser
+# Parent 
+
+testmessage
+
+diff -r ... a8
+--- /dev/null
++++ b/a8
+@@ -0,0 +1,1 @@
++content for a8
+35: testmessage - origuser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User origuser
+# Date 4 0
+# Parent 
+
+testmessage
+
+36: testmessage - origuser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+36: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+37: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+37: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+38: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+39: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+39: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+39: testmessage - test
+
+======== Patches with a message and (current) user header
+==== qnew
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+40: testmessage - test
+==== qref
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+diff -r ... a9
+--- /dev/null
++++ b/a9
+@@ -0,0 +1,1 @@
++content for a9
+40: testmessage - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# User test
+# Date 4 0
+# Parent 
+
+testmessage
+
+41: testmessage - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+41: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+42: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+42: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+43: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+44: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+testmessage
+
+44: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+testmessage
+
+44: testmessage - test
+
+======== Patches with a message and date header
+==== qnew
+# HG changeset patch
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+45: testmessage - test
+==== qref
+# HG changeset patch
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+diff -r ... a10
+--- /dev/null
++++ b/a10
+@@ -0,0 +1,1 @@
++content for a10
+45: testmessage - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+testmessage
+
+46: testmessage - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+46: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+47: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+47: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+48: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+49: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+49: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+49: testmessage - test
+
+======== Patches with a message and (specific) user and date header
+==== qnew
+# HG changeset patch
+# User origuser
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+50: testmessage - origuser
+==== qref
+# HG changeset patch
+# User origuser
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+diff -r ... a11
+--- /dev/null
++++ b/a11
+@@ -0,0 +1,1 @@
++content for a11
+50: testmessage - origuser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User origuser
+# Date 4 0
+# Parent 
+
+testmessage
+
+51: testmessage - origuser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+51: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+52: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+52: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+53: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+54: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+54: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+54: testmessage - test
+
+======== Patches with a message and (current) user and date header
+==== qnew
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+55: testmessage - test
+==== qref
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+diff -r ... a12
+--- /dev/null
++++ b/a12
+@@ -0,0 +1,1 @@
++content for a12
+55: testmessage - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# User test
+# Date 4 0
+# Parent 
+
+testmessage
+
+56: testmessage - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+56: testmessage - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+57: testmessage - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+57: testmessage - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+testmessage
+
+58: testmessage - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+59: testmessage - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+59: testmessage - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 1265068800 0
+# Parent 
+
+testmessage
+
+59: testmessage - test
+
+======== Patches with a forced HG header
+==== qnew
+# HG changeset patch
+60: imported patch a13.patch - test
+==== qref
+# HG changeset patch
+# Parent 
+
+diff -r ... a13
+--- /dev/null
++++ b/a13
+@@ -0,0 +1,1 @@
++content for a13
+60: [mq]: a13.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+61: [mq]: b13.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+61: [mq]: b13.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+62: [mq]: c13.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+62: [mq]: c13.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+63: [mq]: d13.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+64: [mq]: e13.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+64: [mq]: e13.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+64: [mq]: e13.patch - test
+
+======== Patches with a forced HG header including user
+==== qnew
+# HG changeset patch
+# User hguser
+65: imported patch a14.patch - hguser
+==== qref
+# HG changeset patch
+# User hguser
+# Parent 
+
+diff -r ... a14
+--- /dev/null
++++ b/a14
+@@ -0,0 +1,1 @@
++content for a14
+65: [mq]: a14.patch - hguser
+==== qnew
+==== qref -d
+# HG changeset patch
+# User hguser
+# Date 4 0
+# Parent 
+
+66: [mq]: b14.patch - hguser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+66: [mq]: b14.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+67: [mq]: c14.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+67: [mq]: c14.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+68: [mq]: d14.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+69: [mq]: e14.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+69: [mq]: e14.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+69: [mq]: e14.patch - test
+
+======== Patches with a forced HG header including date
+==== qnew
+# HG changeset patch
+# Date 10 0
+70: imported patch a15.patch - test
+==== qref
+# HG changeset patch
+# Date 10 0
+# Parent 
+
+diff -r ... a15
+--- /dev/null
++++ b/a15
+@@ -0,0 +1,1 @@
++content for a15
+70: [mq]: a15.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+71: [mq]: b15.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+71: [mq]: b15.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+72: [mq]: c15.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+72: [mq]: c15.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+73: [mq]: d15.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+74: [mq]: e15.patch - test
+
+======== Patches with a forced HG header including user and date
+==== qnew
+==== writing HG user and date headers
+# HG changeset patch
+# User hguser
+# Date 10 0
+75: imported patch a16.patch - hguser
+==== qref
+# HG changeset patch
+# User hguser
+# Date 10 0
+# Parent 
+
+diff -r ... a16
+--- /dev/null
++++ b/a16
+@@ -0,0 +1,1 @@
++content for a16
+75: [mq]: a16.patch - hguser
+==== qnew
+==== writing HG user and date headers
+==== qref -d
+# HG changeset patch
+# User hguser
+# Date 4 0
+# Parent 
+
+76: [mq]: b16.patch - hguser - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+76: [mq]: b16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+77: [mq]: c16.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+77: [mq]: c16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+78: [mq]: d16.patch - john - 4.00
+==== qnew
+==== writing HG user and date headers
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Date 10 0
+# Parent 
+
+79: [mq]: e16.patch - test
+
+======== Patches with a forced plain header
+==== qnew
+80: [mq]: a17.patch - test
+==== qref
+# HG changeset patch
+# Parent 
+
+diff -r ... a17
+--- /dev/null
++++ b/a17
+@@ -0,0 +1,1 @@
++content for a17
+80: [mq]: a17.patch - test
+==== qnew
+==== qref -d
+# HG changeset patch
+# Date 4 0
+# Parent 
+
+81: [mq]: b17.patch - test - 4.00
+==== qref -u
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+81: [mq]: b17.patch - john - 4.00
+==== qnew
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+82: [mq]: c17.patch - john
+==== qref -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+82: [mq]: c17.patch - john - 4.00
+==== qnew
+==== qref -u -d
+# HG changeset patch
+# User john
+# Date 4 0
+# Parent 
+
+83: [mq]: d17.patch - john - 4.00
+==== qnew
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+84: [mq]: e17.patch - test
+==== qref -u
+# HG changeset patch
+# User john
+# Parent 
+
+84: [mq]: e17.patch - john
+==== qref -U
+# HG changeset patch
+# User test
+# Parent 
+
+84: [mq]: e17.patch - test
+
+======== Patches with a forced plain header including user
+==== qnew
+From: plainuser
+85: imported patch a18.patch - plainuser
+==== qref
+From: plainuser
+
+diff -r ... a18
+--- /dev/null
++++ b/a18
+@@ -0,0 +1,1 @@
++content for a18
+85: [mq]: a18.patch - plainuser
+==== qnew
+==== qref -d
+From: plainuser
+Date: 4 0
+
+86: [mq]: b18.patch - plainuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+86: [mq]: b18.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+
+87: [mq]: c18.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+87: [mq]: c18.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+88: [mq]: d18.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+
+89: [mq]: e18.patch - test
+==== qref -u
+From: john
+
+89: [mq]: e18.patch - john
+==== qref -U
+From: test
+
+89: [mq]: e18.patch - test
+
+======== Patches with a forced plain header including date
+==== qnew
+Date: 10 0
+90: imported patch a19.patch - test
+==== qref
+Date: 10 0
+
+diff -r ... a19
+--- /dev/null
++++ b/a19
+@@ -0,0 +1,1 @@
++content for a19
+90: [mq]: a19.patch - test
+==== qnew
+==== qref -d
+Date: 4 0
+
+91: [mq]: b19.patch - test - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+91: [mq]: b19.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 10 0
+
+92: [mq]: c19.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+92: [mq]: c19.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+93: [mq]: d19.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 10 0
+
+94: [mq]: e19.patch - test
+==== qref -u
+From: john
+Date: 10 0
+
+94: [mq]: e19.patch - john
+==== qref -U
+From: test
+Date: 10 0
+
+94: [mq]: e19.patch - test
+
+======== Patches with a forced plain header including user and date
+==== qnew
+From: plainuser
+Date: 10 0
+95: imported patch a20.patch - plainuser
+==== qref
+From: plainuser
+Date: 10 0
+
+diff -r ... a20
+--- /dev/null
++++ b/a20
+@@ -0,0 +1,1 @@
++content for a20
+95: [mq]: a20.patch - plainuser
+==== qnew
+==== qref -d
+From: plainuser
+Date: 4 0
+
+96: [mq]: b20.patch - plainuser - 4.00
+==== qref -u
+From: john
+Date: 4 0
+
+96: [mq]: b20.patch - john - 4.00
+==== qnew
+==== qref -u
+From: john
+Date: 10 0
+
+97: [mq]: c20.patch - john
+==== qref -d
+From: john
+Date: 4 0
+
+97: [mq]: c20.patch - john - 4.00
+==== qnew
+==== qref -u -d
+From: john
+Date: 4 0
+
+98: [mq]: d20.patch - john - 4.00
+==== qnew
+==== qref -U
+From: test
+Date: 10 0
+
+99: [mq]: e20.patch - test
+==== qref -u
+From: john
+Date: 10 0
+
+99: [mq]: e20.patch - john
+==== qref -U
+From: test
+Date: 10 0
+
+99: [mq]: e20.patch - test


More information about the Mercurial-devel mailing list