Patchwork [2,of,8] mq: write headers for new HG patches in the same order as export

login
register
mail settings
Submitter Mads Kiilerich
Date Sept. 24, 2014, 1 a.m.
Message ID <ad1c120809ec524aef93.1411520403@localhost.localdomain>
Download mbox | patch
Permalink /patch/5948/
State Accepted
Headers show

Comments

Mads Kiilerich - Sept. 24, 2014, 1 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1411225616 -7200
#      Sat Sep 20 17:06:56 2014 +0200
# Node ID ad1c120809ec524aef939a1235752f9b2f4742c7
# Parent  88ed3d2d9014f7b4bc102292db514c4397c72d2e
mq: write headers for new HG patches in the same order as export

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1077,12 +1077,12 @@  class queue(object):
                         p.write("Date: %d %d\n" % date)
                 else:
                     p.write("# HG changeset patch\n")
-                    p.write("# Parent "
-                            + hex(repo[None].p1().node()) + "\n")
                     if user:
                         p.write("# User " + user + "\n")
                     if date:
                         p.write("# Date %s %s\n" % date)
+                    p.write("# Parent "
+                            + hex(repo[None].p1().node()) + "\n")
 
                 defaultmsg = "[mq]: %s" % patchfn
                 editor = cmdutil.getcommiteditor(editform=editform)
diff --git a/tests/test-mq-git.t b/tests/test-mq-git.t
--- a/tests/test-mq-git.t
+++ b/tests/test-mq-git.t
@@ -17,8 +17,8 @@  git=auto: regular patch creation:
 
   $ cat .hg/patches/adda
   # HG changeset patch
+  # Date 0 0
   # Parent 0000000000000000000000000000000000000000
-  # Date 0 0
   
   diff -r 000000000000 -r ef8dafc9fa4c a
   --- /dev/null
@@ -33,8 +33,8 @@  git=auto: git patch creation with copy:
 
   $ cat .hg/patches/copy
   # HG changeset patch
+  # Date 0 0
   # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-  # Date 0 0
   
   diff --git a/a b/b
   copy from a
@@ -48,8 +48,8 @@  git=auto: git patch when using --git:
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
-  # Date 0 0
   
   diff --git a/regular b/regular
   new file mode 100644
@@ -64,8 +64,8 @@  git=auto: regular patch after qrefresh w
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
-  # Date 0 0
   
   diff -r 99586d5f048c regular
   --- /dev/null
@@ -88,8 +88,8 @@  git=keep: git patch with --git:
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 0000000000000000000000000000000000000000
-  # Date 0 0
   
   diff --git a/a b/a
   new file mode 100644
@@ -105,8 +105,8 @@  git=keep: git patch after qrefresh witho
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 0000000000000000000000000000000000000000
-  # Date 0 0
   
   diff --git a/a b/a
   new file mode 100644
@@ -130,8 +130,8 @@  git=yes: git patch:
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 0000000000000000000000000000000000000000
-  # Date 0 0
   
   diff --git a/a b/a
   new file mode 100644
@@ -147,8 +147,8 @@  git=yes: git patch after qrefresh:
 
   $ cat .hg/patches/git
   # HG changeset patch
+  # Date 0 0
   # Parent 0000000000000000000000000000000000000000
-  # Date 0 0
   
   diff --git a/a b/a
   new file mode 100644
@@ -176,8 +176,8 @@  git=no: regular patch with copy:
 
   $ cat .hg/patches/regular
   # HG changeset patch
+  # Date 0 0
   # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-  # Date 0 0
   
   diff -r ef8dafc9fa4c -r a70404f79ba3 b
   --- /dev/null
@@ -192,8 +192,8 @@  git=no: regular patch after qrefresh wit
 
   $ cat .hg/patches/regular
   # HG changeset patch
+  # Date 0 0
   # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-  # Date 0 0
   
   diff -r ef8dafc9fa4c b
   --- /dev/null
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
@@ -528,15 +528,15 @@ 
   ==== init
   ==== qnew -d
   # HG changeset patch
+  # Date 3 0
   # Parent 
-  # Date 3 0
   
   0: [mq]: 1.patch - test - 3.00
   ==== qref
   adding 1
   # HG changeset patch
+  # Date 3 0
   # Parent 
-  # Date 3 0
   
   diff -r ... 1
   --- /dev/null
@@ -546,8 +546,8 @@ 
   0: [mq]: 1.patch - test - 3.00
   ==== qref -d
   # HG changeset patch
+  # Date 4 0
   # Parent 
-  # Date 4 0
   
   diff -r ... 1
   --- /dev/null
@@ -583,8 +583,8 @@ 
   now at: 1.patch
   ==== qnew -d -m
   # HG changeset patch
+  # Date 6 0
   # Parent 
-  # Date 6 0
   Three
   
   1: Three - test - 6.00
@@ -592,8 +592,8 @@ 
   ==== qref
   adding 3
   # HG changeset patch
+  # Date 6 0
   # Parent 
-  # Date 6 0
   Three
   
   diff -r ... 3
@@ -605,8 +605,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qref -m
   # HG changeset patch
+  # Date 6 0
   # Parent 
-  # Date 6 0
   Drei
   
   diff -r ... 3
@@ -618,8 +618,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qref -d
   # HG changeset patch
+  # Date 7 0
   # Parent 
-  # Date 7 0
   Drei
   
   diff -r ... 3
@@ -631,8 +631,8 @@ 
   0: [mq]: 1.patch - test - 4.00
   ==== qref -d -m
   # HG changeset patch
+  # Date 8 0
   # Parent 
-  # Date 8 0
   Three (again)
   
   diff -r ... 3
@@ -747,8 +747,8 @@ 
   ==== qnew -u
   adding 6
   # HG changeset patch
+  # User jane
   # Parent 
-  # User jane
   
   diff -r ... 6
   --- /dev/null
@@ -762,8 +762,8 @@ 
   ==== qref -d
   # HG changeset patch
   # Date 12 0
+  # User jane
   # Parent 
-  # User jane
   
   diff -r ... 6
   --- /dev/null
@@ -779,8 +779,8 @@ 
   ==== qnew -d
   adding 7
   # HG changeset patch
+  # Date 13 0
   # Parent 
-  # Date 13 0
   
   diff -r ... 7
   --- /dev/null
@@ -794,8 +794,8 @@ 
   ==== qref -u
   # HG changeset patch
   # User john
+  # Date 13 0
   # Parent 
-  # Date 13 0
   
   diff -r ... 7
   --- /dev/null
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
@@ -399,15 +399,15 @@ 
   ==== init
   ==== qnew -U
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   
   0: [mq]: 1.patch - test
   ==== qref
   adding 1
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   
   diff -r ... 1
   --- /dev/null
@@ -417,8 +417,8 @@ 
   0: [mq]: 1.patch - test
   ==== qref -u
   # HG changeset patch
+  # User mary
   # Parent 
-  # User mary
   
   diff -r ... 1
   --- /dev/null
@@ -452,8 +452,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qnew -U -m
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Three
   
   2: Three - test
@@ -462,8 +462,8 @@ 
   ==== qref
   adding 3
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Three
   
   diff -r ... 3
@@ -476,8 +476,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -m
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Drei
   
   diff -r ... 3
@@ -490,8 +490,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u
   # HG changeset patch
+  # User mary
   # Parent 
-  # User mary
   Drei
   
   diff -r ... 3
@@ -504,8 +504,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u -m
   # HG changeset patch
+  # User maria
   # Parent 
-  # User maria
   Three (again)
   
   diff -r ... 3
@@ -684,15 +684,15 @@ 
   ==== init
   ==== qnew -U
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   
   0: [mq]: 1.patch - test
   ==== qref
   adding 1
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   
   diff -r ... 1
   --- /dev/null
@@ -702,8 +702,8 @@ 
   0: [mq]: 1.patch - test
   ==== qref -u
   # HG changeset patch
+  # User mary
   # Parent 
-  # User mary
   
   diff -r ... 1
   --- /dev/null
@@ -737,8 +737,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qnew -U -m
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Three
   
   2: Three - test
@@ -747,8 +747,8 @@ 
   ==== qref
   adding 3
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Three
   
   diff -r ... 3
@@ -761,8 +761,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -m
   # HG changeset patch
+  # User test
   # Parent 
-  # User test
   Drei
   
   diff -r ... 3
@@ -775,8 +775,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u
   # HG changeset patch
+  # User mary
   # Parent 
-  # User mary
   Drei
   
   diff -r ... 3
@@ -789,8 +789,8 @@ 
   0: [mq]: 1.patch - mary
   ==== qref -u -m
   # HG changeset patch
+  # User maria
   # Parent 
-  # User maria
   Three (again)
   
   diff -r ... 3
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
@@ -160,8 +160,8 @@  Check patcha2 is still a regular patch:
 
   $ cat .hg/patches/patcha2
   # HG changeset patch
+  # Date 0 0
   # Parent ???????????????????????????????????????? (glob)
-  # Date 0 0
   
   diff -r ???????????? -r ???????????? a (glob)
   --- a/a
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
@@ -218,13 +218,13 @@  hg headers
   +b
   % qnew -u with no username configured
   # HG changeset patch
+  # User blue
   # Parent 
-  # User blue
   
   % qnew -e -u with no username configured
   # HG changeset patch
+  # User chartreuse
   # Parent 
-  # User chartreuse
   
   % fail when trying to import a merge
   adding a
diff --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t
+++ b/tests/test-mq-subrepo.t
@@ -419,9 +419,9 @@  both into 'revision' and 'patch file und
   +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
   $ cat .hg/patches/import-at-qnew
   # HG changeset patch
-  # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
   # User test
   # Date 0 0
+  # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
   
   diff -r f499373e340c -r f69e96d86e75 .hgsub
   --- /dev/null
@@ -554,9 +554,9 @@  check whether qrefresh imports updated .
   +88ac1bef5ed43b689d1d200b59886b675dec474b sub
   $ cat .hg/patches/checkstate-at-qnew
   # HG changeset patch
-  # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
   # User test
   # Date 0 0
+  # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
   
   diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
   --- a/.hgsubstate