[PATCH 3 of 3] extdiff: use @command decorator to set up diff commands

Yuya Nishihara yuya at tcha.org
Wed Jan 6 09:31:02 CST 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1451655334 -32400
#      Fri Jan 01 22:35:34 2016 +0900
# Node ID 92fba84837f39d19c1c9d33b9b6c4f041c134a6a
# Parent  7cef792466ed42cf6c619992a7bbc51ab7a9c33e
extdiff: use @command decorator to set up diff commands

It can set "inferrepo" attribute appropriately.

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -369,6 +369,5 @@ use %(path)s to diff repository (or sele
             # right encoding) prevents that.
             mydiff.__doc__ = doc.decode(encoding.encoding)
             return mydiff
-        cmdtable[cmd] = (save(cmdline),
-                         extdiffopts[:],
-                         _('hg %s [OPTION]... [FILE]...') % cmd)
+        command(cmd, extdiffopts[:], _('hg %s [OPTION]... [FILE]...') % cmd,
+                inferrepo=True)(save(cmdline))


More information about the Mercurial-devel mailing list