mq: simplify commit message generation
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 14 Mar 2010 00:53:55 +0100
changeset 10679 35abaea778dc
parent 10678 da2a0c9c895d
child 10680 45eb9b5dacf6
mq: simplify commit message generation
hgext/mq.py
--- a/hgext/mq.py	Sun Mar 14 00:36:10 2010 +0100
+++ b/hgext/mq.py	Sun Mar 14 00:53:55 2010 +0100
@@ -1544,7 +1544,6 @@
             self.ui.warn(_("status is already saved\n"))
             return 1
 
-        ar = [':' + x for x in self.full_series]
         if not msg:
             msg = _("hg patches saved state")
         else:
@@ -1554,9 +1553,9 @@
             pp = r.dirstate.parents()
             msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1]))
         msg += "\n\nPatch Data:\n"
-        text = msg + "\n".join([str(x) for x in self.applied]) + '\n' + (ar and
-                   "\n".join(ar) + '\n' or "")
-        n = repo.commit(text, force=True)
+        msg += ''.join('%s\n' % x for x in self.applied)
+        msg += ''.join(':%s\n' % x for x in self.full_series)
+        n = repo.commit(msg, force=True)
         if not n:
             self.ui.warn(_("repo commit failed\n"))
             return 1