Mercurial > hg-stable
diff hgext/record.py @ 25797:cc9fb45986d4
record: omit meaningless 'qnew' suggestion at 'hg qnew -i'
Before this patch, 'hg qnew -i' under non-interactive mode suggests
'use qnew instead', and it obviously meaningless.
To omit meaningless 'qnew' suggestion at 'hg qnew -i', this patch adds
internal function '_qrecord()' and specifies 'cmdsuggest' for each of
'qrecord' and 'qnew' separately.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 15 Jul 2015 04:45:58 +0900 |
parents | 4eb8d8a44bf1 |
children | 08f2177b15c7 |
line wrap: on
line diff
--- a/hgext/record.py Wed Jul 15 04:45:58 2015 +0900 +++ b/hgext/record.py Wed Jul 15 04:45:58 2015 +0900 @@ -93,7 +93,9 @@ See :hg:`help qnew` & :hg:`help record` for more information and usage. ''' + return _qrecord('qnew', ui, repo, patch, *pats, **opts) +def _qrecord(cmdsuggest, ui, repo, patch, *pats, **opts): try: mq = extensions.find('mq') except KeyError: @@ -108,14 +110,14 @@ backup = ui.backupconfig('experimental', 'crecord') try: ui.setconfig('experimental', 'crecord', False, 'record') - cmdutil.dorecord(ui, repo, committomq, 'qnew', False, + cmdutil.dorecord(ui, repo, committomq, cmdsuggest, False, cmdutil.recordfilter, *pats, **opts) finally: ui.restoreconfig(backup) def qnew(origfn, ui, repo, patch, *args, **opts): if opts['interactive']: - return qrecord(ui, repo, patch, *args, **opts) + return _qrecord(None, ui, repo, patch, *args, **opts) return origfn(ui, repo, patch, *args, **opts)