hgext/mq.py
changeset 11947 59ec12093261
parent 11939 7d2ea5ce4aac
child 11966 22f1994fb669
--- a/hgext/mq.py	Tue Aug 17 17:38:19 2010 -0500
+++ b/hgext/mq.py	Mon Aug 16 16:35:20 2010 -0300
@@ -2041,6 +2041,10 @@
     If -s/--short is specified, files currently included in the patch
     will be refreshed just like matched files and remain in the patch.
 
+    If -e/--edit is specified, Mercurial will start your configured editor for
+    you to enter a message. In case qrefresh fails, you will find a backup of
+    your message in ``.hg/last-message.txt``.
+
     hg add/remove/copy/rename work as usual, though you might want to
     use git-style patches (-g/--git or [diff] git=1) to track copies
     and renames. See the diffs help topic for more information on the
@@ -2057,6 +2061,10 @@
         patch = q.applied[-1].name
         ph = patchheader(q.join(patch), q.plainmode)
         message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
+        # We don't want to lose the patch message if qrefresh fails (issue2062)
+        msgfile = repo.opener('last-message.txt', 'wb')
+        msgfile.write(message)
+        msgfile.close()
     setupheaderopts(ui, opts)
     ret = q.refresh(repo, pats, msg=message, **opts)
     q.save_dirty()