--- a/mercurial/debugcommands.py Sun Dec 10 19:39:39 2017 +0900
+++ b/mercurial/debugcommands.py Sun Dec 10 19:41:49 2017 +0900
@@ -873,15 +873,18 @@
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 = ui.formatter('debugformat', opts)
fm.plain('format-variant')
fm.plain(' ' * (maxvariantlength - len('format-variant')))
fm.plain(' repo')