# HG changeset patch # User Boris Feld # Date 1512659120 -3600 # Node ID cfb403b92f43385f43387eaddac4a66c92ca941a # Parent c3e4f196b6e07e627f2d624b0b3fb19c4742865c 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. diff -r c3e4f196b6e0 -r cfb403b92f43 mercurial/debugcommands.py --- 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) diff -r c3e4f196b6e0 -r cfb403b92f43 tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t Thu Dec 07 16:19:46 2017 +0100 +++ b/tests/test-upgrade-repo.t Thu Dec 07 16:05:20 2017 +0100 @@ -60,6 +60,18 @@ dotencode: yes generaldelta: yes plain-cl-delta: yes + $ hg debugformat --verbose + format-variant repo config default + fncache: yes yes yes + dotencode: yes yes yes + generaldelta: yes yes yes + plain-cl-delta: yes yes yes + $ hg debugformat --verbose --config format.usegfncache=no + format-variant repo config default + fncache: yes yes yes + dotencode: yes yes yes + generaldelta: yes yes yes + plain-cl-delta: yes yes yes $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: @@ -113,6 +125,18 @@ dotencode: no generaldelta: no plain-cl-delta: yes + $ hg debugformat --verbose + format-variant repo config default + fncache: no yes yes + dotencode: no yes yes + generaldelta: no yes yes + plain-cl-delta: yes yes yes + $ hg debugformat --verbose --config format.usegeneraldelta=no + format-variant repo config default + fncache: no yes yes + dotencode: no yes yes + generaldelta: no no yes + plain-cl-delta: yes yes yes $ hg debugupgraderepo repository lacks features recommended by current config options: