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