mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
cmdutil: allow callers of cmdutil.dorecord to omit suggestion
Interactive committing under non-interactive mode shows command suggestion, but sometimes it is meaningless. command suggestion usability ------------ ---------- ----------- record commit commit -i commit meaningless qrecord qnew qnew -i qnew meaningless qrefersh -i qrefresh meaningless shelve -i commit incorrect ------------ ---------- ----------- This patch allows callers of 'cmdutil.dorecord()' to omit meaningless suggestion by passing None or so for 'cmdsuggest' argument of it. This is a preparation for subsequent patches, which fix each suggestion issues above.
This commit is contained in:
parent
f8c9284f5c
commit
10e6e169f7
@ -81,8 +81,11 @@ def dorecord(ui, repo, commitfunc, cmdsuggest, backupall,
|
|||||||
import merge as mergemod
|
import merge as mergemod
|
||||||
|
|
||||||
if not ui.interactive():
|
if not ui.interactive():
|
||||||
raise util.Abort(_('running non-interactively, use %s instead') %
|
if cmdsuggest:
|
||||||
cmdsuggest)
|
msg = _('running non-interactively, use %s instead') % cmdsuggest
|
||||||
|
else:
|
||||||
|
msg = _('running non-interactively')
|
||||||
|
raise util.Abort(msg)
|
||||||
|
|
||||||
# make sure username is set before going interactive
|
# make sure username is set before going interactive
|
||||||
if not opts.get('user'):
|
if not opts.get('user'):
|
||||||
|
Loading…
Reference in New Issue
Block a user