##// END OF EJS Templates
debugformat: embed raw values in JSON and template output
Yuya Nishihara -
r35379:9144e898 default
parent child Browse files
Show More
@@ -873,15 +873,18 b' def debugformat(ui, repo, **opts):'
873 def makeformatname(name):
873 def makeformatname(name):
874 return '%s:' + (' ' * (maxvariantlength - len(name)))
874 return '%s:' + (' ' * (maxvariantlength - len(name)))
875
875
876 def formatvalue(value):
876 fm = ui.formatter('debugformat', opts)
877 if util.safehasattr(value, 'startswith'):
877 if fm.isplain():
878 return value
878 def formatvalue(value):
879 if value:
879 if util.safehasattr(value, 'startswith'):
880 return 'yes'
880 return value
881 else:
881 if value:
882 return 'no'
882 return 'yes'
883 else:
884 return 'no'
885 else:
886 formatvalue = pycompat.identity
883
887
884 fm = ui.formatter('debugformat', opts)
885 fm.plain('format-variant')
888 fm.plain('format-variant')
886 fm.plain(' ' * (maxvariantlength - len('format-variant')))
889 fm.plain(' ' * (maxvariantlength - len('format-variant')))
887 fm.plain(' repo')
890 fm.plain(' repo')
@@ -85,28 +85,28 b' An upgrade of a repository created with '
85 $ hg debugformat -Tjson
85 $ hg debugformat -Tjson
86 [
86 [
87 {
87 {
88 "config": "yes",
88 "config": true,
89 "default": "yes",
89 "default": true,
90 "name": "fncache",
90 "name": "fncache",
91 "repo": "yes"
91 "repo": true
92 },
92 },
93 {
93 {
94 "config": "yes",
94 "config": true,
95 "default": "yes",
95 "default": true,
96 "name": "dotencode",
96 "name": "dotencode",
97 "repo": "yes"
97 "repo": true
98 },
98 },
99 {
99 {
100 "config": "yes",
100 "config": true,
101 "default": "yes",
101 "default": true,
102 "name": "generaldelta",
102 "name": "generaldelta",
103 "repo": "yes"
103 "repo": true
104 },
104 },
105 {
105 {
106 "config": "yes",
106 "config": true,
107 "default": "yes",
107 "default": true,
108 "name": "plain-cl-delta",
108 "name": "plain-cl-delta",
109 "repo": "yes"
109 "repo": true
110 },
110 },
111 {
111 {
112 "config": "zlib",
112 "config": "zlib",
General Comments 0
You need to be logged in to leave comments. Login now