changeset 2746:0503eb5c0a33

Add option -e/--edit to qrefresh, to edit the existing header.
author Brendan Cully <brendan@kublai.com>
date Mon, 31 Jul 2006 17:55:43 -0700
parents 1bac2bfe081a
children 0016fc748f61
files hgext/mq.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'),