Patchwork [2,of,9,PoC] mq2: stabilize tests

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 29, 2014, 8:59 a.m.
Message ID <608e1f1b2b20f5ea5445.1409302759@localhost.localdomain>
Download mbox | patch
Permalink /patch/5614/
State Changes Requested
Headers show

Comments

Mads Kiilerich - Aug. 29, 2014, 8:59 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1409301991 -7200
#      Fri Aug 29 10:46:31 2014 +0200
# Node ID 608e1f1b2b20f5ea54458edcbcbf406d66cbdf42
# Parent  e426af93a42f11fb187793904b743b5b4341af6e
mq2: stabilize tests

Most of it do not make any obvious difference right now but it helps when
adding new tests or debug statements.

Patch

diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -6,10 +6,13 @@  Test interactions between mq and patch.e
   $ echo "mq=" >> $HGRCPATH
   $ echo "[diff]" >> $HGRCPATH
   $ echo "nodates=1" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ cat > makepatch.py <<EOF
   > f = file('eol.diff', 'wb')
   > w = f.write
+  > w('Date: 1 0\n')
   > w('test message\n')
   > w('diff --git a/a b/a\n')
   > w('--- a/a\n')
@@ -84,6 +87,7 @@  force LF
   now at: eol.diff
   $ hg qrefresh
   $ python ../cateol.py .hg/patches/eol.diff
+  Date: 1 0<LF>
   test message<LF>
   <LF>
   diff -r 0d0bf99a8b7a a<LF>
diff --git a/tests/test-mq-guards.t b/tests/test-mq-guards.t
--- a/tests/test-mq-guards.t
+++ b/tests/test-mq-guards.t
@@ -1,5 +1,7 @@ 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init
   $ hg qinit
diff --git a/tests/test-mq-header-date.t b/tests/test-mq-header-date.t
--- a/tests/test-mq-header-date.t
+++ b/tests/test-mq-header-date.t
@@ -3,6 +3,9 @@ 
   $ echo "mq=" >> $HGRCPATH
   $ echo "[diff]" >> $HGRCPATH
   $ echo "nodates=true" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ catpatch() {
   >     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
   >                                    -e "s/^\(# Parent \).*/\1/"
@@ -222,6 +225,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qnew
   adding 2
+  Date: 1 0
+  
   diff -r ... 2
   --- /dev/null
   +++ b/2
@@ -299,6 +304,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qnew -m
   adding 4
+  Date: 1 0
+  
   Four
   
   diff -r ... 4
@@ -311,6 +318,7 @@ 
   0: [mq]: 1.patch - test
   ==== qref -d
   Date: 9 0
+  
   Four
   
   diff -r ... 4
@@ -326,6 +334,8 @@ 
   ==== qnew with HG header
   popping 5.patch
   now at: 3.patch
+  Date: 1 0
+  
   # HG changeset patch
   # Date 10 0
   2: imported patch 5.patch - test - 10.00
@@ -333,6 +343,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== hg qref
   adding 5
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # Date 10 0
@@ -346,6 +358,8 @@ 
   1: Three (again) - test - 8.00
   0: [mq]: 1.patch - test - 4.00
   ==== hg qref -d
+  Date: 11 0
+  
   # HG changeset patch
   # Parent 
   # Date 11 0
@@ -398,6 +412,7 @@ 
   ==== qnew -u
   adding 6
   From: jane
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -409,8 +424,8 @@ 
   1: Three (again) - test
   0: [mq]: 1.patch - test
   ==== qref -d
+  From: jane
   Date: 12 0
-  From: jane
   
   diff -r ... 6
   --- /dev/null
@@ -451,6 +466,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qnew
   adding 8
+  Date: 1 0
+  
   diff -r ... 8
   --- /dev/null
   +++ b/8
@@ -462,8 +479,8 @@ 
   1: Three (again) - test
   0: [mq]: 1.patch - test
   ==== qref -u -d
+  From: john
   Date: 14 0
-  From: john
   
   diff -r ... 8
   --- /dev/null
@@ -479,6 +496,8 @@ 
   now at: 7.patch
   ==== qnew -m
   adding 9
+  Date: 1 0
+  
   Nine
   
   diff -r ... 9
@@ -492,8 +511,9 @@ 
   1: Three (again) - test
   0: [mq]: 1.patch - test
   ==== qref -u -d
+  From: john
   Date: 15 0
-  From: john
+  
   Nine
   
   diff -r ... 9
@@ -564,6 +584,7 @@ 
   adding 2
   # HG changeset patch
   # Parent 
+  # Date 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -574,8 +595,8 @@ 
   0: [mq]: 1.patch - test
   ==== qref -d
   # HG changeset patch
+  # Parent 
   # Date 5 0
-  # Parent 
   
   diff -r ... 2
   --- /dev/null
@@ -656,6 +677,8 @@ 
   adding 4
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   Four
   
   diff -r ... 4
@@ -668,8 +691,9 @@ 
   0: [mq]: 1.patch - test
   ==== qref -d
   # HG changeset patch
+  # Parent 
   # Date 9 0
-  # Parent 
+  
   Four
   
   diff -r ... 4
@@ -685,6 +709,8 @@ 
   ==== qnew with HG header
   popping 5.patch
   now at: 3.patch
+  Date: 1 0
+  
   # HG changeset patch
   # Date 10 0
   2: imported patch 5.patch - test - 10.00
@@ -692,6 +718,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== hg qref
   adding 5
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # Date 10 0
@@ -705,6 +733,8 @@ 
   1: Three (again) - test - 8.00
   0: [mq]: 1.patch - test - 4.00
   ==== hg qref -d
+  Date: 11 0
+  
   # HG changeset patch
   # Parent 
   # Date 11 0
@@ -759,6 +789,7 @@ 
   # HG changeset patch
   # Parent 
   # User jane
+  # Date 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -771,9 +802,9 @@ 
   0: [mq]: 1.patch - test
   ==== qref -d
   # HG changeset patch
-  # Date 12 0
   # Parent 
   # User jane
+  # Date 12 0
   
   diff -r ... 6
   --- /dev/null
@@ -820,6 +851,7 @@ 
   adding 8
   # HG changeset patch
   # Parent 
+  # Date 1 0
   
   diff -r ... 8
   --- /dev/null
@@ -833,9 +865,9 @@ 
   0: [mq]: 1.patch - test
   ==== qref -u -d
   # HG changeset patch
-  # Date 14 0
   # User john
   # Parent 
+  # Date 14 0
   
   diff -r ... 8
   --- /dev/null
@@ -853,6 +885,8 @@ 
   adding 9
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   Nine
   
   diff -r ... 9
@@ -867,9 +901,10 @@ 
   0: [mq]: 1.patch - test
   ==== qref -u -d
   # HG changeset patch
-  # Date 15 0
   # User john
   # Parent 
+  # Date 15 0
+  
   Nine
   
   diff -r ... 9
diff --git a/tests/test-mq-header-from.t b/tests/test-mq-header-from.t
--- a/tests/test-mq-header-from.t
+++ b/tests/test-mq-header-from.t
@@ -3,6 +3,9 @@ 
   $ echo "mq=" >> $HGRCPATH
   $ echo "[diff]" >> $HGRCPATH
   $ echo "nodates=true" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ catlog() {
   >     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
   >                                    -e "s/^\(# Parent \).*/\1/"
@@ -134,11 +137,13 @@ 
   ==== init
   ==== qnew -U
   From: test
+  Date: 1 0
   
   0: [mq]: 1.patch - test
   ==== qref
   adding 1
   From: test
+  Date: 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -148,6 +153,7 @@ 
   0: [mq]: 1.patch - test
   ==== qref -u
   From: mary
+  Date: 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -157,6 +163,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qnew
   adding 2
+  Date: 1 0
+  
   diff -r ... 2
   --- /dev/null
   +++ b/2
@@ -166,6 +174,7 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u
   From: jane
+  Date: 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -176,6 +185,7 @@ 
   0: [mq]: 1.patch - mary
   ==== qnew -U -m
   From: test
+  Date: 1 0
   
   Three
   
@@ -185,6 +195,7 @@ 
   ==== qref
   adding 3
   From: test
+  Date: 1 0
   
   Three
   
@@ -198,6 +209,7 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -m
   From: test
+  Date: 1 0
   
   Drei
   
@@ -211,6 +223,7 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u
   From: mary
+  Date: 1 0
   
   Drei
   
@@ -224,6 +237,7 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u -m
   From: maria
+  Date: 1 0
   
   Three (again)
   
@@ -237,6 +251,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qnew -m
   adding 4of
+  Date: 1 0
+  
   Four
   
   diff -r ... 4of
@@ -250,6 +266,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u
   From: jane
+  Date: 1 0
+  
   Four
   
   diff -r ... 4of
@@ -265,6 +283,8 @@ 
   popping 5.patch
   now at: 4.patch
   now at: 5.patch
+  Date: 1 0
+  
   # HG changeset patch
   # User johndoe
   4: imported patch 5.patch - johndoe
@@ -274,6 +294,8 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref
   adding 5
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndoe
@@ -289,6 +311,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -U
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User test
@@ -304,6 +328,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -u
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndeere
@@ -323,6 +349,7 @@ 
   now at: 5.patch
   now at: 6.patch
   From: test
+  Date: 1 0
   
   5: imported patch 6.patch - test
   4: [mq]: 5.patch - johndeere
@@ -333,6 +360,7 @@ 
   ==== hg qref
   adding 6
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -347,6 +375,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -U
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -361,6 +390,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -u
   From: johndeere
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -406,12 +436,15 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   0: [mq]: 1.patch - test
   ==== qref
   adding 1
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -423,6 +456,7 @@ 
   # HG changeset patch
   # Parent 
   # User mary
+  # Date 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -434,6 +468,7 @@ 
   adding 2
   # HG changeset patch
   # Parent 
+  # Date 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -446,6 +481,7 @@ 
   # HG changeset patch
   # User jane
   # Parent 
+  # Date 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -458,6 +494,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Three
   
   2: Three - test
@@ -468,6 +506,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Three
   
   diff -r ... 3
@@ -482,6 +522,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Drei
   
   diff -r ... 3
@@ -496,6 +538,8 @@ 
   # HG changeset patch
   # Parent 
   # User mary
+  # Date 1 0
+  
   Drei
   
   diff -r ... 3
@@ -510,6 +554,8 @@ 
   # HG changeset patch
   # Parent 
   # User maria
+  # Date 1 0
+  
   Three (again)
   
   diff -r ... 3
@@ -524,6 +570,8 @@ 
   adding 4of
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   Four
   
   diff -r ... 4of
@@ -539,6 +587,8 @@ 
   # HG changeset patch
   # User jane
   # Parent 
+  # Date 1 0
+  
   Four
   
   diff -r ... 4of
@@ -554,6 +604,8 @@ 
   popping 5.patch
   now at: 4.patch
   now at: 5.patch
+  Date: 1 0
+  
   # HG changeset patch
   # User johndoe
   4: imported patch 5.patch - johndoe
@@ -563,6 +615,8 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref
   adding 5
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndoe
@@ -578,6 +632,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -U
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User test
@@ -593,6 +649,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -u
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndeere
@@ -612,6 +670,7 @@ 
   now at: 5.patch
   now at: 6.patch
   From: test
+  Date: 1 0
   
   5: imported patch 6.patch - test
   4: [mq]: 5.patch - johndeere
@@ -622,6 +681,7 @@ 
   ==== hg qref
   adding 6
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -636,6 +696,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -U
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -650,6 +711,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -u
   From: johndeere
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -690,12 +752,15 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   0: [mq]: 1.patch - test
   ==== qref
   adding 1
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -707,6 +772,7 @@ 
   # HG changeset patch
   # Parent 
   # User mary
+  # Date 1 0
   
   diff -r ... 1
   --- /dev/null
@@ -718,6 +784,7 @@ 
   adding 2
   # HG changeset patch
   # Parent 
+  # Date 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -730,6 +797,7 @@ 
   # HG changeset patch
   # User jane
   # Parent 
+  # Date 1 0
   
   diff -r ... 2
   --- /dev/null
@@ -742,6 +810,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Three
   
   2: Three - test
@@ -752,6 +822,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Three
   
   diff -r ... 3
@@ -766,6 +838,8 @@ 
   # HG changeset patch
   # Parent 
   # User test
+  # Date 1 0
+  
   Drei
   
   diff -r ... 3
@@ -780,6 +854,8 @@ 
   # HG changeset patch
   # Parent 
   # User mary
+  # Date 1 0
+  
   Drei
   
   diff -r ... 3
@@ -794,6 +870,8 @@ 
   # HG changeset patch
   # Parent 
   # User maria
+  # Date 1 0
+  
   Three (again)
   
   diff -r ... 3
@@ -808,6 +886,8 @@ 
   adding 4of
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   Four
   
   diff -r ... 4of
@@ -823,6 +903,8 @@ 
   # HG changeset patch
   # User jane
   # Parent 
+  # Date 1 0
+  
   Four
   
   diff -r ... 4of
@@ -838,6 +920,8 @@ 
   popping 5.patch
   now at: 4.patch
   now at: 5.patch
+  Date: 1 0
+  
   # HG changeset patch
   # User johndoe
   4: imported patch 5.patch - johndoe
@@ -847,6 +931,8 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref
   adding 5
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndoe
@@ -862,6 +948,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -U
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User test
@@ -877,6 +965,8 @@ 
   1: [mq]: 2.patch - jane
   0: [mq]: 1.patch - mary
   ==== hg qref -u
+  Date: 1 0
+  
   # HG changeset patch
   # Parent 
   # User johndeere
@@ -896,6 +986,7 @@ 
   now at: 5.patch
   now at: 6.patch
   From: test
+  Date: 1 0
   
   5: imported patch 6.patch - test
   4: [mq]: 5.patch - johndeere
@@ -906,6 +997,7 @@ 
   ==== hg qref
   adding 6
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -920,6 +1012,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -U
   From: test
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
@@ -934,6 +1027,7 @@ 
   0: [mq]: 1.patch - mary
   ==== hg qref -u
   From: johndeere
+  Date: 1 0
   
   diff -r ... 6
   --- /dev/null
diff --git a/tests/test-mq-merge.t b/tests/test-mq-merge.t
--- a/tests/test-mq-merge.t
+++ b/tests/test-mq-merge.t
@@ -49,7 +49,7 @@  Commit two dummy files in "init" changes
 
 Create a patch removing a:
 
-  $ hg qnew rm_a
+  $ hg qnew rm_a -d '0 0'
   $ hg rm a
   $ hg qrefresh -m "rm a"
 
@@ -108,7 +108,7 @@  Classic MQ merge sequence *with an expli
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg cp a aa
   $ echo c >> a
-  $ hg qnew --git -f -e patcha
+  $ hg qnew --git -f -e patcha -d '0 0'
   $ echo d >> a
   $ hg qnew -d '0 0' -f -e patcha2
 
@@ -139,6 +139,7 @@  Check patcha is still a git patch:
   $ cat .hg/patches/patcha
   # HG changeset patch
   # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
+  # Date 0 0
   
   diff --git a/a b/a
   --- a/a
diff --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t
--- a/tests/test-mq-missingfiles.t
+++ b/tests/test-mq-missingfiles.t
@@ -20,6 +20,8 @@  future qrefresh.
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init normal
   $ cd normal
@@ -36,6 +38,7 @@  future qrefresh.
   patch queue now empty
   $ hg rm b
   $ hg ci -Am rmb
+  $ hg tag -l rmb
 
 Push patch with missing target:
 
@@ -88,7 +91,7 @@  Test missing renamed file
   $ hg qpop
   popping changebb
   patch queue now empty
-  $ hg up -qC 1
+  $ hg up -qC rmb
   $ hg qpush
   applying changebb
   patching file bb
diff --git a/tests/test-mq-qclone-http.t b/tests/test-mq-qclone-http.t
--- a/tests/test-mq-qclone-http.t
+++ b/tests/test-mq-qclone-http.t
@@ -5,6 +5,9 @@  hide outer repo
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ mkdir webdir
   $ cd webdir
   $ hg init a
diff --git a/tests/test-mq-qdelete.t b/tests/test-mq-qdelete.t
--- a/tests/test-mq-qdelete.t
+++ b/tests/test-mq-qdelete.t
@@ -1,5 +1,7 @@ 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init a
   $ cd a
@@ -55,9 +57,11 @@  Delete the same patch twice in one comma
 
   $ hg qapplied
 
-  $ hg log --template '{rev} {desc}\n'
-  1 [mq]: pa
-  0 base
+  $ hg log -G --template '{rev} {desc}\n'
+  @  1 [mq]: pa
+  |
+  o  0 base
+  
 
   $ hg qnew pd
   $ hg qnew pe
@@ -74,12 +78,17 @@  Delete the same patch twice in one comma
   $ hg qapplied
   pf
 
-  $ hg log --template '{rev} {desc}\n'
-  4 [mq]: pf
-  3 [mq]: pe
-  2 [mq]: pd
-  1 [mq]: pa
-  0 base
+  $ hg log -G --template '{rev} {desc}\n'
+  @  4 [mq]: pf
+  |
+  o  3 [mq]: pe
+  |
+  o  2 [mq]: pd
+  |
+  o  1 [mq]: pa
+  |
+  o  0 base
+  
 
   $ cd ..
 
@@ -129,22 +138,30 @@  Delete the same patch twice in one comma
   $ hg qapplied
   pc
 
-  $ hg log --template '{rev} {desc}\n'
-  3 imported patch pc
-  2 [mq]: pb
-  1 [mq]: pa
-  0 base
+  $ hg log -G --template '{rev} {desc}\n'
+  @  3 imported patch pc
+  |
+  o  2 [mq]: pb
+  |
+  o  1 [mq]: pa
+  |
+  o  0 base
+  
 
   $ hg qfinish -a pc
   patch pc finalized without changeset message
 
   $ hg qapplied
 
-  $ hg log --template '{rev} {desc}\n'
-  3 imported patch pc
-  2 [mq]: pb
-  1 [mq]: pa
-  0 base
+  $ hg log -G --template '{rev} {desc}\n'
+  @  3 imported patch pc
+  |
+  o  2 [mq]: pb
+  |
+  o  1 [mq]: pa
+  |
+  o  0 base
+  
 
   $ ls .hg/patches
   series
diff --git a/tests/test-mq-qfold.t b/tests/test-mq-qfold.t
--- a/tests/test-mq-qfold.t
+++ b/tests/test-mq-qfold.t
@@ -4,6 +4,8 @@ 
   $ echo "git=keep" >> $HGRCPATH
   $ echo "[diff]" >> $HGRCPATH
   $ echo "nodates=1" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
 init:
 
@@ -88,6 +90,7 @@  Fold git patch into a regular patch, exp
   $ cat .hg/patches/regular
   # HG changeset patch
   # Parent ???????????????????????????????????????? (glob)
+  # Date 1 0
   
   diff --git a/a b/a
   --- a/a
@@ -130,6 +133,7 @@  Fold regular patch into a git patch, exp
   $ cat .hg/patches/git
   # HG changeset patch
   # Parent ???????????????????????????????????????? (glob)
+  # Date 1 0
   
   diff --git a/a b/aa
   copy from a
@@ -258,4 +262,3 @@  and that combination of '--edit' and '--
   A aa
 
   $ cd ..
-
diff --git a/tests/test-mq-qgoto.t b/tests/test-mq-qgoto.t
--- a/tests/test-mq-qgoto.t
+++ b/tests/test-mq-qgoto.t
@@ -1,5 +1,7 @@ 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init a
   $ cd a
diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t
--- a/tests/test-mq-qimport.t
+++ b/tests/test-mq-qimport.t
@@ -100,7 +100,8 @@  import URL
 
   $ echo foo >> foo
   $ hg add foo
-  $ hg diff > url.diff
+  $ echo 'Date: 0 0' > url.diff
+  $ hg diff >> url.diff
   $ hg revert --no-backup foo
   $ rm foo
 
@@ -119,7 +120,8 @@  import patch that already exists
 
   $ echo foo2 >> foo
   $ hg add foo
-  $ hg diff > ../url.diff
+  $ echo 'Date: 0 0' > ../url.diff
+  $ hg diff >> ../url.diff
   $ hg revert --no-backup foo
   $ rm foo
   $ hg qimport ../url.diff
@@ -153,7 +155,8 @@  build diff with CRLF
   $ hg ci -Am addb
   adding b
   $ python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
-  $ hg diff > b.diff
+  $ echo 'Date: 0 0' > b.diff
+  $ hg diff >> b.diff
   $ hg up -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -168,6 +171,7 @@  qimport CRLF diff
 try to import --push
 
   $ cat > appendfoo.diff <<EOF
+  > Date: 3 0
   > append foo
   > 
   > diff -r 07f494440405 -r 261500830e46 baz
@@ -178,6 +182,7 @@  try to import --push
   > EOF
 
   $ cat > appendbar.diff <<EOF
+  > Date: 4 0
   > append bar
   > 
   > diff -r 07f494440405 -r 261500830e46 baz
diff --git a/tests/test-mq-qnew.t b/tests/test-mq-qnew.t
--- a/tests/test-mq-qnew.t
+++ b/tests/test-mq-qnew.t
@@ -2,8 +2,12 @@ 
   $ catpatch() {
   >     cat $1 | sed -e "s/^\(# Parent \).*/\1/"
   > }
+
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ runtest() {
   >     hg init mq
   >     cd mq
@@ -125,6 +129,8 @@  plain headers
   % qnew missing
   abort: missing: * (glob)
   % qnew -m
+  Date: 1 0
+  
   foo bar
   
   % qnew twice
@@ -137,6 +143,8 @@  plain headers
   patch queue now empty
   adding d/b
   M d/b
+  Date: 1 0
+  
   diff --git a/d/b b/d/b
   --- a/d/b
   +++ b/d/b
@@ -145,9 +153,11 @@  plain headers
   +b
   % qnew -u with no username configured
   From: blue
+  Date: 1 0
   
   % qnew -e -u with no username configured
   From: chartreuse
+  Date: 1 0
   
   % fail when trying to import a merge
   adding a
@@ -195,6 +205,8 @@  hg headers
   % qnew -m
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   foo bar
   
   % qnew twice
@@ -209,6 +221,8 @@  hg headers
   M d/b
   # HG changeset patch
   # Parent 
+  # Date 1 0
+  
   diff --git a/d/b b/d/b
   --- a/d/b
   +++ b/d/b
@@ -219,10 +233,14 @@  hg headers
   # HG changeset patch
   # Parent 
   # User blue
+  # Date 1 0
+  
   % qnew -e -u with no username configured
   # HG changeset patch
   # Parent 
   # User chartreuse
+  # Date 1 0
+  
   % fail when trying to import a merge
   adding a
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -337,6 +355,8 @@  Test handling default message with the p
   $ cat ".hg/patches/patch "
   # HG changeset patch
   # Parent 0000000000000000000000000000000000000000
+  # Date 1 0
+  
 
   $ cd ..
 
diff --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t
--- a/tests/test-mq-qpush-fail.t
+++ b/tests/test-mq-qpush-fail.t
@@ -2,6 +2,9 @@  Test that qpush cleans things up if it d
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ hg init repo
   $ cd repo
   $ echo foo > foo
diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t
--- a/tests/test-mq-qrefresh-replace-log-message.t
+++ b/tests/test-mq-qrefresh-replace-log-message.t
@@ -2,6 +2,9 @@  Environment setup for MQ
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
   $ hg init
   $ hg qinit
 
diff --git a/tests/test-mq-qrefresh.t b/tests/test-mq-qrefresh.t
--- a/tests/test-mq-qrefresh.t
+++ b/tests/test-mq-qrefresh.t
@@ -2,6 +2,8 @@ 
   $ echo "mq=" >> $HGRCPATH
   $ echo "[diff]" >> $HGRCPATH
   $ echo "nodates=1" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init a
   $ cd a
@@ -50,6 +52,8 @@ 
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -99,6 +103,8 @@ 
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -143,6 +149,8 @@  qrefresh . in subdir:
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -187,6 +195,8 @@  qrefresh in hg-root again:
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -235,6 +245,8 @@  qrefresh --short tests:
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -268,6 +280,8 @@  Before starting exclusive tests:
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -290,6 +304,8 @@  Exclude 2/base:
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -313,6 +329,8 @@  Remove 1/base and add 2/base again but n
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 2/base
@@ -329,6 +347,8 @@  Add 1/base with include filter - and thu
   $ cat .hg/patches/mqbase
   # HG changeset patch
   # Parent e7af5904b465cd1f4f3cf6b26fe14e8db6f63eaa
+  # Date 1 0
+  
   mqbase
   
   diff -r e7af5904b465 1/base
@@ -454,6 +474,7 @@  refresh with tip != qtip:
   $ cat .hg/patches/patch
   # HG changeset patch
   # Parent 1a60229be7ac3e4a7f647508e99b87bef1f03593
+  # Date 1 0
   
   diff -r 1a60229be7ac b
   --- a/b
@@ -508,6 +529,8 @@  but only after writing the bad name into
   $ cat .hg/patches/a
   # HG changeset patch
   # Parent 0000000000000000000000000000000000000000
+  # Date 1 0
+  
   diff --git a/a b/a
   new file mode 100644
   $ hg qpush
@@ -522,6 +545,8 @@  but only after writing the bad name into
   $ cat .hg/patches/a
   # HG changeset patch
   # Parent 0000000000000000000000000000000000000000
+  # Date 1 0
+  
   diff --git a/a b/a
   new file mode 100644
   $ cd ..
diff --git a/tests/test-mq-qrename.t b/tests/test-mq-qrename.t
--- a/tests/test-mq-qrename.t
+++ b/tests/test-mq-qrename.t
@@ -1,6 +1,8 @@ 
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init a
   $ cd a
@@ -114,6 +116,7 @@  Test renaming to a folded patch (issue30
   $ cat .hg/patches/addb
   # HG changeset patch
   # Parent 0000000000000000000000000000000000000000
+  # Date 1 0
   
   diff -r 000000000000 a
   --- /dev/null	* (glob)
diff --git a/tests/test-mq-safety.t b/tests/test-mq-safety.t
--- a/tests/test-mq-safety.t
+++ b/tests/test-mq-safety.t
@@ -1,5 +1,7 @@ 
   $ echo '[extensions]' >> $HGRCPATH
   $ echo 'hgext.mq =' >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init repo
   $ cd repo
@@ -115,27 +117,27 @@  qpush warning branchheads
   $ hg ci -mmerge
   $ hg up default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg log
-  changeset:   2:65309210bf4e
-  branch:      b
-  tag:         tip
-  parent:      1:707adb4c8ae1
-  parent:      0:cb9a9f314b8b
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     merge
-  
-  changeset:   1:707adb4c8ae1
-  branch:      b
-  parent:      -1:000000000000
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     c
-  
-  changeset:   0:cb9a9f314b8b
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     a
+  $ hg log -G
+  o    changeset:   2:65309210bf4e
+  |\   branch:      b
+  | |  tag:         tip
+  | |  parent:      1:707adb4c8ae1
+  | |  parent:      0:cb9a9f314b8b
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     merge
+  | |
+  | o  changeset:   1:707adb4c8ae1
+  |    branch:      b
+  |    parent:      -1:000000000000
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     c
+  |
+  @  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
   
   $ hg qpush
   applying qp
diff --git a/tests/test-mq-symlinks.t b/tests/test-mq-symlinks.t
--- a/tests/test-mq-symlinks.t
+++ b/tests/test-mq-symlinks.t
@@ -2,6 +2,8 @@ 
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "mq=" >> $HGRCPATH
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
 
   $ hg init
   $ hg qinit
diff --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -11,6 +11,9 @@ 
   $ echo "[mq]" >> $HGRCPATH
   $ echo "plain=true" >> $HGRCPATH
 
+  $ echo "[defaults]" >> $HGRCPATH
+  $ echo "qnew=-d '1 0'" >> $HGRCPATH
+
 
 help
 
@@ -261,6 +264,8 @@  qrefresh
   $ echo a >> a
   $ hg qrefresh
   $ cat .hg/patches/test.patch
+  Date: 1 0
+  
   foo bar
   
   diff -r [a-f0-9]* a (re)
@@ -276,11 +281,13 @@  empty qrefresh
 
 revision:
 
-  $ hg diff -r -2 -r -1
+  $ hg diff -r '.^' -r '.'
 
 patch:
 
   $ cat .hg/patches/test.patch
+  Date: 1 0
+  
   foo bar
   
 
@@ -663,7 +670,7 @@  push should succeed
   $ hg qpop -a
   popping test.patch
   patch queue now empty
-  $ hg push ../../k
+  $ hg push ../../k -r .
   pushing to ../../k
   searching for changes
   adding changesets
@@ -820,6 +827,8 @@  cd b; hg qrefresh
   $ hg add f
   $ hg qrefresh
   $ cat ../.hg/patches/foo
+  Date: 1 0
+  
   foo
   
   diff -r cb9a9f314b8b a
@@ -838,6 +847,8 @@  hg qrefresh .
 
   $ hg qrefresh .
   $ cat ../.hg/patches/foo
+  Date: 1 0
+  
   foo
   
   diff -r cb9a9f314b8b b/f
@@ -879,16 +890,21 @@  qpush failure
 
 mq tags
 
-  $ hg log --template '{rev} {tags}\n' -r qparent:qtip
-  0 qparent
-  1 foo qbase
-  2 bar qtip tip
+  $ hg log -G --template '{rev} {tags}\n' -r qparent:qtip
+  @  2 bar qtip tip
+  |
+  o  1 foo qbase
+  |
+  o  0 qparent
+  
 
 mq revset
 
-  $ hg log -r 'mq()' --template '{rev}\n'
-  1
-  2
+  $ hg log -G -r 'mq()' --template '{rev}\n'
+  @  2
+  |
+  o  1
+  |
   $ hg help revsets | grep -i mq
       "mq()"
         Changesets managed by MQ.
@@ -934,6 +950,8 @@  git patches
   $ hg qrefresh
 #if execbit
   $ cat .hg/patches/new
+  Date: 1 0
+  
   new file
   
   diff --git a/new b/new
@@ -958,6 +976,8 @@  git patches
   $ hg cp new copy
   $ hg qrefresh
   $ cat .hg/patches/copy
+  Date: 1 0
+  
   copy file
   
   diff --git a/new b/copy
@@ -1022,10 +1042,12 @@  test file addition in slow path
   $ echo >> foo
   $ hg ci -m 'change foo'
   created new head
-  $ hg up -C 1
+  $ hg up -C bar
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg qrefresh --git
   $ cat .hg/patches/bar
+  Date: 1 0
+  
   diff --git a/bar b/bar
   new file mode 100644
   --- /dev/null
@@ -1039,6 +1061,8 @@  test file addition in slow path
   2 baz (foo)
   $ hg qrefresh --git
   $ cat .hg/patches/bar
+  Date: 1 0
+  
   diff --git a/bar b/bar
   new file mode 100644
   --- /dev/null
@@ -1058,16 +1082,18 @@  test file addition in slow path
 
 test file move chains in the slow path
 
-  $ hg up -C 1
+  $ hg up -C 'head()-bar'
   1 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ echo >> foo
   $ hg ci -m 'change foo again'
-  $ hg up -C 2
+  $ hg up -C bar
   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg mv bar quux
   $ hg mv baz bleh
   $ hg qrefresh --git
   $ cat .hg/patches/bar
+  Date: 1 0
+  
   diff --git a/foo b/bleh
   rename from foo
   rename to bleh
@@ -1083,6 +1109,8 @@  test file move chains in the slow path
   $ hg mv bleh barney
   $ hg qrefresh --git
   $ cat .hg/patches/bar
+  Date: 1 0
+  
   diff --git a/foo b/barney
   rename from foo
   rename to barney
@@ -1507,6 +1535,14 @@  Proper phase default with mq:
 
 1. mq.secret=false
 
+  $ hg log -G --hidden -T '{rev}  {tags}  {desc|firstline}\n'
+  @  2  modify-file qtip tip  imported patch modify-file
+  |
+  o  1  add-file2  imported patch add-file2
+  |
+  o  0  add-file1 qbase  imported patch add-file1
+  
+
   $ rm .hg/store/phaseroots
   $ hg phase 'qparent::'
   0: draft
@@ -1544,7 +1580,7 @@  Test that qfinish respect phases.new-com
 
   $ sed -e 's/new-commit=secret//' $HGRCPATH > $TESTTMP/sedtmp
   $ cp $TESTTMP/sedtmp $HGRCPATH
-  $ hg qimport -r 1 --name  add-file2
+  $ hg qimport -r 'tip^' --name  add-file2
 
 Test that qfinish preserve phase when mq.secret=false