Patchwork [29,of,35] extdiff: define inferrepo in command decorator

login
register
mail settings
Submitter Gregory Szorc
Date May 5, 2014, 5:51 a.m.
Message ID <75277696df23760fdcc7.1399269094@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/4620/
State Accepted
Commit f0c3b95af47f3a6d647eaab2272a1aea5902f03c
Headers show

Comments

Gregory Szorc - May 5, 2014, 5:51 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1399267767 25200
#      Sun May 04 22:29:27 2014 -0700
# Branch stable
# Node ID 75277696df23760fdcc7fd94c0d192e920a2c73f
# Parent  24499eebef38fd7fc3a67467bbdab9a17b0169f0
extdiff: define inferrepo in command decorator

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -243,17 +243,18 @@  def dodiff(ui, repo, diffcmd, diffopts, 
 @command('extdiff',
     [('p', 'program', '',
      _('comparison program to run'), _('CMD')),
     ('o', 'option', [],
      _('pass option to comparison program'), _('OPT')),
     ('r', 'rev', [], _('revision'), _('REV')),
     ('c', 'change', '', _('change made by revision'), _('REV')),
     ] + commands.walkopts,
-    _('hg extdiff [OPT]... [FILE]...'))
+    _('hg extdiff [OPT]... [FILE]...'),
+    inferrepo=True)
 def extdiff(ui, repo, *pats, **opts):
     '''use external program to diff repository (or selected files)
 
     Show differences between revisions for the specified files, using
     an external program. The default program used is diff, with
     default options "-Npru".
 
     To select a different program, use the -p/--program option. The
@@ -320,10 +321,8 @@  use %(path)s to diff repository (or sele
             # fail when the docstring contains non-ASCII characters.
             # Decoding the string to a Unicode string here (using the
             # right encoding) prevents that.
             mydiff.__doc__ = doc.decode(encoding.encoding)
             return mydiff
         cmdtable[cmd] = (save(cmd, path, diffopts),
                          cmdtable['extdiff'][1][1:],
                          _('hg %s [OPTION]... [FILE]...') % cmd)
-
-commands.inferrepo += " extdiff"