mq: write headers for new HG patches in the same order as export (BC)
authorMads Kiilerich <madski@unity3d.com>
Sat, 20 Sep 2014 17:06:56 +0200
changeset 22520 9d4ebb75de53
parent 22519 c87f2a5a6e49
child 22521 3f948469bac0
mq: write headers for new HG patches in the same order as export (BC)
hgext/mq.py
tests/test-mq-git.t
tests/test-mq-header-date.t
tests/test-mq-header-from.t
tests/test-mq-merge.t
tests/test-mq-qnew.t
tests/test-mq-subrepo.t
--- a/hgext/mq.py	Sat Sep 20 17:06:56 2014 +0200
+++ b/hgext/mq.py	Sat Sep 20 17:06:56 2014 +0200
@@ -1077,12 +1077,12 @@
                         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)
--- a/tests/test-mq-git.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-git.t	Sat Sep 20 17:06:56 2014 +0200
@@ -17,8 +17,8 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ 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 @@
 
   $ cat .hg/patches/regular
   # HG changeset patch
+  # Date 0 0
   # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
-  # Date 0 0
   
   diff -r ef8dafc9fa4c b
   --- /dev/null
--- a/tests/test-mq-header-date.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-header-date.t	Sat Sep 20 17:06:56 2014 +0200
@@ -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
--- a/tests/test-mq-header-from.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-header-from.t	Sat Sep 20 17:06:56 2014 +0200
@@ -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
--- a/tests/test-mq-merge.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-merge.t	Sat Sep 20 17:06:56 2014 +0200
@@ -160,8 +160,8 @@
 
   $ cat .hg/patches/patcha2
   # HG changeset patch
+  # Date 0 0
   # Parent ???????????????????????????????????????? (glob)
-  # Date 0 0
   
   diff -r ???????????? -r ???????????? a (glob)
   --- a/a
--- a/tests/test-mq-qnew.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-qnew.t	Sat Sep 20 17:06:56 2014 +0200
@@ -218,13 +218,13 @@
   +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
--- a/tests/test-mq-subrepo.t	Sat Sep 20 17:06:56 2014 +0200
+++ b/tests/test-mq-subrepo.t	Sat Sep 20 17:06:56 2014 +0200
@@ -419,9 +419,9 @@
   +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 @@
   +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