# HG changeset patch # User Gregory Szorc # Date 1399267935 25200 # Node ID 44efd5b9ce458cdf91666e3584d791b4adb7da12 # Parent 82bf4d89e06842286d2314e4ab6b4252c41d70cc keyword: define inferrepo in command decorator diff -r 82bf4d89e068 -r 44efd5b9ce45 hgext/keyword.py --- a/hgext/keyword.py Sun May 04 22:33:22 2014 -0700 +++ b/hgext/keyword.py Sun May 04 22:32:15 2014 -0700 @@ -89,8 +89,6 @@ from mercurial.i18n import _ import os, re, shutil, tempfile -commands.inferrepo += ' kwexpand kwfiles kwshrink' - cmdtable = {} command = cmdutil.command(cmdtable) testedwith = 'internal' @@ -454,7 +452,10 @@ ui.write(repo.wread(fn)) shutil.rmtree(tmpdir, ignore_errors=True) -@command('kwexpand', commands.walkopts, _('hg kwexpand [OPTION]... [FILE]...')) +@command('kwexpand', + commands.walkopts, + _('hg kwexpand [OPTION]... [FILE]...'), + inferrepo=True) def expand(ui, repo, *pats, **opts): '''expand keywords in the working directory @@ -470,7 +471,8 @@ ('i', 'ignore', None, _('show files excluded from expansion')), ('u', 'unknown', None, _('only show unknown (not tracked) files')), ] + commands.walkopts, - _('hg kwfiles [OPTION]... [FILE]...')) + _('hg kwfiles [OPTION]... [FILE]...'), + inferrepo=True) def files(ui, repo, *pats, **opts): '''show files configured for keyword expansion @@ -524,7 +526,10 @@ repo.pathto(f, cwd), label=label) fm.end() -@command('kwshrink', commands.walkopts, _('hg kwshrink [OPTION]... [FILE]...')) +@command('kwshrink', + commands.walkopts, + _('hg kwshrink [OPTION]... [FILE]...'), + inferrepo=True) def shrink(ui, repo, *pats, **opts): '''revert expanded keywords in the working directory