##// END OF EJS Templates
mq: do not invoke editor until just before patch creation. Closes issue1346.
Brendan Cully -
r7157:fd3cba5e default
parent child Browse files
Show More
@@ -641,6 +641,9 b' class queue:'
641 641 % name)
642 642
643 643 def new(self, repo, patch, *pats, **opts):
644 """options:
645 msg: a string or a no-argument function returning a string
646 """
644 647 msg = opts.get('msg')
645 648 force = opts.get('force')
646 649 user = opts.get('user')
@@ -661,6 +664,8 b' class queue:'
661 664 wlock = repo.wlock()
662 665 try:
663 666 insert = self.full_series_end()
667 if callable(msg):
668 msg = msg()
664 669 commitmsg = msg and msg or ("[mq]: %s" % patch)
665 670 n = repo.commit(commitfiles, commitmsg, user, date, match=match, force=True)
666 671 if n == None:
@@ -1735,11 +1740,14 b' def new(ui, repo, patch, *args, **opts):'
1735 1740 -e, -m or -l set the patch header as well as the commit message.
1736 1741 If none is specified, the patch header is empty and the
1737 1742 commit message is '[mq]: PATCH'"""
1743 msg = cmdutil.logmessage(opts)
1744 def getmsg(): return ui.edit(msg, ui.username())
1738 1745 q = repo.mq
1739 message = cmdutil.logmessage(opts)
1740 if opts['edit']:
1741 message = ui.edit(message, ui.username())
1742 opts['msg'] = message
1746 opts['msg'] = msg
1747 if opts.get('edit'):
1748 opts['msg'] = getmsg
1749 else:
1750 opts['msg'] = msg
1743 1751 setupheaderopts(ui, opts)
1744 1752 q.new(repo, patch, *args, **opts)
1745 1753 q.save_dirty()
General Comments 0
You need to be logged in to leave comments. Login now