# HG changeset patch # User Gregory Szorc # Date 1399268002 25200 # Node ID 82bf4d89e06842286d2314e4ab6b4252c41d70cc # Parent 404eca1ce4f91aa6f7ff026272c6a85cb268996f hgk: define inferrepo in command decorator diff -r 404eca1ce4f9 -r 82bf4d89e068 hgext/hgk.py --- a/hgext/hgk.py Sun May 04 22:28:46 2014 -0700 +++ b/hgext/hgk.py Sun May 04 22:33:22 2014 -0700 @@ -50,7 +50,8 @@ ('s', 'stdin', None, _('stdin')), ('C', 'copy', None, _('detect copies')), ('S', 'search', "", _('search'))], - ('hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...')) + ('hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'), + inferrepo=True) def difftree(ui, repo, node1=None, node2=None, *files, **opts): """diff trees from two commits""" def __difftree(repo, node1, node2, files=[]): @@ -145,7 +146,8 @@ @command('debug-cat-file', [('s', 'stdin', None, _('stdin'))], - _('hg debug-cat-file [OPTION]... TYPE FILE')) + _('hg debug-cat-file [OPTION]... TYPE FILE'), + inferrepo=True) def catfile(ui, repo, type=None, r=None, **opts): """cat a specific revision""" # in stdin mode, every line except the commit is prefixed with two @@ -344,5 +346,3 @@ cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) ui.debug("running %s\n" % cmd) util.system(cmd) - -commands.inferrepo += " debug-diff-tree debug-cat-file"