##// END OF EJS Templates
keyword: define inferrepo in command decorator
Gregory Szorc -
r21784:44efd5b9 default
parent child Browse files
Show More
@@ -89,8 +89,6 b' 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.inferrepo += ' kwexpand kwfiles kwshrink'
93
94 cmdtable = {}
92 cmdtable = {}
95 command = cmdutil.command(cmdtable)
93 command = cmdutil.command(cmdtable)
96 testedwith = 'internal'
94 testedwith = 'internal'
@@ -454,7 +452,10 b' def demo(ui, repo, *args, **opts):'
454 ui.write(repo.wread(fn))
452 ui.write(repo.wread(fn))
455 shutil.rmtree(tmpdir, ignore_errors=True)
453 shutil.rmtree(tmpdir, ignore_errors=True)
456
454
457 @command('kwexpand', commands.walkopts, _('hg kwexpand [OPTION]... [FILE]...'))
455 @command('kwexpand',
456 commands.walkopts,
457 _('hg kwexpand [OPTION]... [FILE]...'),
458 inferrepo=True)
458 def expand(ui, repo, *pats, **opts):
459 def expand(ui, repo, *pats, **opts):
459 '''expand keywords in the working directory
460 '''expand keywords in the working directory
460
461
@@ -470,7 +471,8 b' def expand(ui, repo, *pats, **opts):'
470 ('i', 'ignore', None, _('show files excluded from expansion')),
471 ('i', 'ignore', None, _('show files excluded from expansion')),
471 ('u', 'unknown', None, _('only show unknown (not tracked) files')),
472 ('u', 'unknown', None, _('only show unknown (not tracked) files')),
472 ] + commands.walkopts,
473 ] + commands.walkopts,
473 _('hg kwfiles [OPTION]... [FILE]...'))
474 _('hg kwfiles [OPTION]... [FILE]...'),
475 inferrepo=True)
474 def files(ui, repo, *pats, **opts):
476 def files(ui, repo, *pats, **opts):
475 '''show files configured for keyword expansion
477 '''show files configured for keyword expansion
476
478
@@ -524,7 +526,10 b' def files(ui, repo, *pats, **opts):'
524 repo.pathto(f, cwd), label=label)
526 repo.pathto(f, cwd), label=label)
525 fm.end()
527 fm.end()
526
528
527 @command('kwshrink', commands.walkopts, _('hg kwshrink [OPTION]... [FILE]...'))
529 @command('kwshrink',
530 commands.walkopts,
531 _('hg kwshrink [OPTION]... [FILE]...'),
532 inferrepo=True)
528 def shrink(ui, repo, *pats, **opts):
533 def shrink(ui, repo, *pats, **opts):
529 '''revert expanded keywords in the working directory
534 '''revert expanded keywords in the working directory
530
535
General Comments 0
You need to be logged in to leave comments. Login now