changeset 249:bd0917068cc7

qsync: fix mq commit message generation A CR was missing when both applied and ready to review patches are generated during a single qsync.
author David Douard <david.douard@logilab.fr>
date Thu, 24 May 2012 00:24:40 +0200
parents 3538b06ae2d2
children 5e47d361206a
files hgext/qsync.py tests/test-qsync.t
diffstat 2 files changed, 32 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/qsync.py	Tue May 22 10:35:04 2012 +0200
+++ b/hgext/qsync.py	Thu May 24 00:24:40 2012 +0200
@@ -107,8 +107,10 @@
                         assert False, "Should be exported"
 
     if review:
-        message += '\n'.join('* applied %s' % x for x in applied_list)
-        message += '\n'.join('* %s ready for review' % x for x in review_list)
+        if applied_list:
+            message += '\n'.join('* applied %s' % x for x in applied_list) + '\n'
+        if review_list:
+            message += '\n'.join('* %s ready for review' % x for x in review_list) + '\n'
     memctx = patch.makememctx(mqrepo, (parent.node(), nullid),
                               message,
                               None,
--- a/tests/test-qsync.t	Tue May 22 10:35:04 2012 +0200
+++ b/tests/test-qsync.t	Thu May 24 00:24:40 2012 +0200
@@ -210,3 +210,31 @@
   $ hg qsync -a
   abort: Nothing changed
   [255]
+
+mixed sync
+
+  $ hg init local
+  $ cd local
+  $ hg qinit -c
+  $ mkcommit a
+  $ mkcommit b
+  $ hg qlog
+  1 - 7c3bad9141dc add b (draft)
+  0 - 1f0dee641bb7 add a (draft)
+  $ hg qsync -a
+  $ hg mqlog
+  1 - qsubmit commit
+  
+  * DEFAULT-add_a.diff ready for review
+  * DEFAULT-add_b.diff ready for review
+  0 - qsubmit init
+  $ hg phase -p 0
+  $ echo "b" >> b
+  $ hg amend
+  $ hg qsync -a
+  $ hg mqlog -l 1
+  2 - qsubmit commit
+  
+  * applied DEFAULT-add_a.diff
+  * DEFAULT-add_b.diff ready for review
+