mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
debugformat: embed raw values in JSON and template output
This commit is contained in:
parent
4087d826c3
commit
822286f829
@ -873,15 +873,18 @@ def debugformat(ui, repo, **opts):
|
||||
def makeformatname(name):
|
||||
return '%s:' + (' ' * (maxvariantlength - len(name)))
|
||||
|
||||
def formatvalue(value):
|
||||
if util.safehasattr(value, 'startswith'):
|
||||
return value
|
||||
if value:
|
||||
return 'yes'
|
||||
else:
|
||||
return 'no'
|
||||
|
||||
fm = ui.formatter('debugformat', opts)
|
||||
if fm.isplain():
|
||||
def formatvalue(value):
|
||||
if util.safehasattr(value, 'startswith'):
|
||||
return value
|
||||
if value:
|
||||
return 'yes'
|
||||
else:
|
||||
return 'no'
|
||||
else:
|
||||
formatvalue = pycompat.identity
|
||||
|
||||
fm.plain('format-variant')
|
||||
fm.plain(' ' * (maxvariantlength - len('format-variant')))
|
||||
fm.plain(' repo')
|
||||
|
@ -85,28 +85,28 @@ An upgrade of a repository created with recommended settings only suggests optim
|
||||
$ hg debugformat -Tjson
|
||||
[
|
||||
{
|
||||
"config": "yes",
|
||||
"default": "yes",
|
||||
"config": true,
|
||||
"default": true,
|
||||
"name": "fncache",
|
||||
"repo": "yes"
|
||||
"repo": true
|
||||
},
|
||||
{
|
||||
"config": "yes",
|
||||
"default": "yes",
|
||||
"config": true,
|
||||
"default": true,
|
||||
"name": "dotencode",
|
||||
"repo": "yes"
|
||||
"repo": true
|
||||
},
|
||||
{
|
||||
"config": "yes",
|
||||
"default": "yes",
|
||||
"config": true,
|
||||
"default": true,
|
||||
"name": "generaldelta",
|
||||
"repo": "yes"
|
||||
"repo": true
|
||||
},
|
||||
{
|
||||
"config": "yes",
|
||||
"default": "yes",
|
||||
"config": true,
|
||||
"default": true,
|
||||
"name": "plain-cl-delta",
|
||||
"repo": "yes"
|
||||
"repo": true
|
||||
},
|
||||
{
|
||||
"config": "zlib",
|
||||
|
Loading…
Reference in New Issue
Block a user