Patchwork [2,of,4] debugextensions: give short name to util.version()

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 4, 2016, 4:13 p.m.
Message ID <fb0ca5876b523dc93d5c.1470327198@mimosa>
Download mbox | patch
Permalink /patch/16088/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 4, 2016, 4:13 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1468155973 -32400
#      Sun Jul 10 22:06:13 2016 +0900
# Node ID fb0ca5876b523dc93d5cb9990a5b22a846b43cc8
# Parent  68800e79b8d859871ab65c731ce127b7026dfac4
debugextensions: give short name to util.version()

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2398,6 +2398,7 @@  def debugdiscovery(ui, repo, remoteurl="
 def debugextensions(ui, **opts):
     '''show information about active extensions'''
     exts = extensions.extensions(ui)
+    hgver = util.version()
     fm = ui.formatter('debugextensions', opts)
     for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
         extsource = extmod.__file__
@@ -2413,8 +2414,7 @@  def debugextensions(ui, **opts):
             if not exttestedwith:
                 fm.plain(_(' (untested!)\n'))
             else:
-                if exttestedwith == ['internal'] or \
-                                util.version() in exttestedwith:
+                if exttestedwith == ['internal'] or hgver in exttestedwith:
                     fm.plain('\n')
                 else:
                     lasttestedversion = exttestedwith[-1]