[PATCH] mercurial: add debugextensions command (issue4676)

Matt Mackall mpm at selenic.com
Wed Sep 16 16:37:49 CDT 2015


On Mon, 2015-09-14 at 01:40 +0200, liscju wrote:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1441896787 -7200
> #      Thu Sep 10 16:53:07 2015 +0200
> # Node ID 5c9e3a9f9b7d149727d9ce3739d3d524def18e80
> # Parent  ea489d94e1dc1fc3dc1dcbef1c86c18c49605ed1
> mercurial: add debugextensions command (issue4676)
> 
> Add debugextensions command to help users debug their extension
> problems. If there are no extensions command prints nothing,
> otherwise it prints names of extension modules. If verbose is
> specified it prints following information for every extension:
> extension name, import source, testedwith and buglink informations.
> Extensions are printed sorted by extension name.

This is looking pretty good. A couple notes:

$ hg debugextensions
color
dbsh(untested!)

Missing space

evolve(3.3.3 3.4-rc!)

No need to tell us about 3.3.3 when we know about 3.4-rc and are running
3.5.

Also, you used the generic formatter but didn't enable the formatter
options:

diff -r b198c3310fb1 mercurial/commands.py
--- a/mercurial/commands.py	Thu Sep 10 16:53:07 2015 +0200
+++ b/mercurial/commands.py	Wed Sep 16 14:35:31 2015 -0700
@@ -2184,7 +2184,7 @@
     for f in ctx.getfileset(expr):
         ui.write("%s\n" % f)
 
- at command('debugextensions', [], norepo=True)
+ at command('debugextensions', formatteropts, norepo=True)
 def debugextensions(ui, **opts):
     exts = extensions.extensions(ui)
     exts_infos = []

With this, we see:


$ hg debugextensions -Tjson
[
 {
  "Extension": "color"
 },
 {
  "Extension": "dbsh"
 },
 {
  "Extension": "evolve",
  "Tested": "3.3.3 3.4-rc"
 },

We probably want lowercase on the keys here and the versions should be a
list.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list