hgext/mq.py
changeset 2746 0503eb5c0a33
parent 2745 1bac2bfe081a
child 2747 0016fc748f61
--- a/hgext/mq.py	Mon Jul 31 18:47:43 2006 -0700
+++ b/hgext/mq.py	Mon Jul 31 17:55:43 2006 -0700
@@ -1273,6 +1273,12 @@
     """update the current patch"""
     q = repo.mq
     message=commands.logmessage(**opts)
+    if opts['edit']:
+        if message:
+            raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
+        patch = q.applied[-1].split(':')[1]
+        (message, comment, user, date, hasdiff) = q.readheaders(patch)
+        message = ui.edit('\n'.join(message), user or ui.username())
     q.refresh(repo, msg=message, short=opts['short'])
     q.save_dirty()
     return 0
@@ -1475,10 +1481,11 @@
          'hg qpush [-f] [-l] [-a] [-m] [-n NAME] [PATCH | INDEX]'),
     "^qrefresh":
         (refresh,
-         [('m', 'message', '', _('change commit message with <text>')),
+         [('e', 'edit', None, _('edit commit message')),
+          ('m', 'message', '', _('change commit message with <text>')),
           ('l', 'logfile', '', _('change commit message with <file> content')),
           ('s', 'short', None, 'short refresh')],
-         'hg qrefresh [-m TEXT] [-l FILE] [-s]'),
+         'hg qrefresh [-e] [-m TEXT] [-l FILE] [-s]'),
     "qrestore":
         (restore,
          [('d', 'delete', None, 'delete save entry'),