hgext/mq.py
changeset 11947 59ec12093261
parent 11939 7d2ea5ce4aac
child 11966 22f1994fb669
equal deleted inserted replaced
11946:851161f07068 11947:59ec12093261
  2039     remaining modifications will remain in the working directory.
  2039     remaining modifications will remain in the working directory.
  2040 
  2040 
  2041     If -s/--short is specified, files currently included in the patch
  2041     If -s/--short is specified, files currently included in the patch
  2042     will be refreshed just like matched files and remain in the patch.
  2042     will be refreshed just like matched files and remain in the patch.
  2043 
  2043 
       
  2044     If -e/--edit is specified, Mercurial will start your configured editor for
       
  2045     you to enter a message. In case qrefresh fails, you will find a backup of
       
  2046     your message in ``.hg/last-message.txt``.
       
  2047 
  2044     hg add/remove/copy/rename work as usual, though you might want to
  2048     hg add/remove/copy/rename work as usual, though you might want to
  2045     use git-style patches (-g/--git or [diff] git=1) to track copies
  2049     use git-style patches (-g/--git or [diff] git=1) to track copies
  2046     and renames. See the diffs help topic for more information on the
  2050     and renames. See the diffs help topic for more information on the
  2047     git diff format.
  2051     git diff format.
  2048     """
  2052     """
  2055         if message:
  2059         if message:
  2056             raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
  2060             raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
  2057         patch = q.applied[-1].name
  2061         patch = q.applied[-1].name
  2058         ph = patchheader(q.join(patch), q.plainmode)
  2062         ph = patchheader(q.join(patch), q.plainmode)
  2059         message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
  2063         message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
       
  2064         # We don't want to lose the patch message if qrefresh fails (issue2062)
       
  2065         msgfile = repo.opener('last-message.txt', 'wb')
       
  2066         msgfile.write(message)
       
  2067         msgfile.close()
  2060     setupheaderopts(ui, opts)
  2068     setupheaderopts(ui, opts)
  2061     ret = q.refresh(repo, pats, msg=message, **opts)
  2069     ret = q.refresh(repo, pats, msg=message, **opts)
  2062     q.save_dirty()
  2070     q.save_dirty()
  2063     return ret
  2071     return ret
  2064 
  2072