Mercurial > hg
comparison hgext/keyword.py @ 21776:c4633e287c56
keyword: define optionalrepo in command decorator
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 04 May 2014 22:16:56 -0700 |
parents | 2668a78df8ba |
children | 44efd5b9ce45 |
comparison
equal
deleted
inserted
replaced
21775:5403245edb3a | 21776:c4633e287c56 |
---|---|
87 from mercurial import scmutil, pathutil | 87 from mercurial import scmutil, pathutil |
88 from mercurial.hgweb import webcommands | 88 from mercurial.hgweb import webcommands |
89 from mercurial.i18n import _ | 89 from mercurial.i18n import _ |
90 import os, re, shutil, tempfile | 90 import os, re, shutil, tempfile |
91 | 91 |
92 commands.optionalrepo += ' kwdemo' | |
93 commands.inferrepo += ' kwexpand kwfiles kwshrink' | 92 commands.inferrepo += ' kwexpand kwfiles kwshrink' |
94 | 93 |
95 cmdtable = {} | 94 cmdtable = {} |
96 command = cmdutil.command(cmdtable) | 95 command = cmdutil.command(cmdtable) |
97 testedwith = 'internal' | 96 testedwith = 'internal' |
361 | 360 |
362 @command('kwdemo', | 361 @command('kwdemo', |
363 [('d', 'default', None, _('show default keyword template maps')), | 362 [('d', 'default', None, _('show default keyword template maps')), |
364 ('f', 'rcfile', '', | 363 ('f', 'rcfile', '', |
365 _('read maps from rcfile'), _('FILE'))], | 364 _('read maps from rcfile'), _('FILE'))], |
366 _('hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...')) | 365 _('hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...'), |
366 optionalrepo=True) | |
367 def demo(ui, repo, *args, **opts): | 367 def demo(ui, repo, *args, **opts): |
368 '''print [keywordmaps] configuration and an expansion example | 368 '''print [keywordmaps] configuration and an expansion example |
369 | 369 |
370 Show current, custom, or default keyword template maps and their | 370 Show current, custom, or default keyword template maps and their |
371 expansions. | 371 expansions. |