Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 25795:69145daacdfa
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 15 Jul 2015 03:43:16 +0900 |
parents | 60c791592aa7 |
children | 221491bbaf7e |
comparison
equal
deleted
inserted
replaced
25794:902148444889 | 25795:69145daacdfa |
---|---|
79 def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, | 79 def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, |
80 filterfn, *pats, **opts): | 80 filterfn, *pats, **opts): |
81 import merge as mergemod | 81 import merge as mergemod |
82 | 82 |
83 if not ui.interactive(): | 83 if not ui.interactive(): |
84 raise util.Abort(_('running non-interactively, use %s instead') % | 84 if cmdsuggest: |
85 cmdsuggest) | 85 msg = _('running non-interactively, use %s instead') % cmdsuggest |
86 else: | |
87 msg = _('running non-interactively') | |
88 raise util.Abort(msg) | |
86 | 89 |
87 # make sure username is set before going interactive | 90 # make sure username is set before going interactive |
88 if not opts.get('user'): | 91 if not opts.get('user'): |
89 ui.username() # raise exception, username not provided | 92 ui.username() # raise exception, username not provided |
90 | 93 |