diff mercurial/debugcommands.py @ 35337:cfb403b92f43

debugformat: add data about the config when verbose In verbose mode, the command also displays the current configuration choice for the variant and the global Mercurial default for it.
author Boris Feld <boris.feld@octobus.net>
date Thu, 07 Dec 2017 16:05:20 +0100
parents c3e4f196b6e0
children bd326f3e0e14
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Thu Dec 07 16:19:46 2017 +0100
+++ b/mercurial/debugcommands.py	Thu Dec 07 16:05:20 2017 +0100
@@ -863,7 +863,10 @@
          [] + cmdutil.formatteropts,
         _(''))
 def debugformat(ui, repo, **opts):
-    """display format information about the current repository"""
+    """display format information about the current repository
+
+    Use --verbose to get extra information about current config value and
+    Mercurial default."""
     maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
     maxvariantlength = max(len('format-variant'), maxvariantlength)
 
@@ -880,15 +883,22 @@
     fm.plain('format-variant')
     fm.plain(' ' * (maxvariantlength - len('format-variant')))
     fm.plain(' repo')
+    if ui.verbose:
+        fm.plain(' config default')
     fm.plain('\n')
     fm.startitem()
     for fv in upgrade.allformatvariant:
         repovalue = fv.fromrepo(repo)
+        configvalue = fv.fromconfig(repo)
 
         fm.write('name', makeformatname(fv.name), fv.name,
                  label='formatvariant.name')
         fm.write('repo', ' %3s', formatvalue(repovalue),
                  label='formatvariant.repo')
+        fm.condwrite(ui.verbose, 'config', ' %6s', formatvalue(configvalue),
+                     label='formatvariant.config')
+        fm.condwrite(ui.verbose, 'default', ' %7s', formatvalue(fv.default),
+                     label='formatvariant.default')
         fm.plain('\n')
 
 @command('debugfsinfo', [], _('[PATH]'), norepo=True)