mercurial/debugcommands.py
changeset 35378 9144e898cad5
parent 35377 c0b6fa74e007
child 35394 a43b2dd95e4f
equal deleted inserted replaced
35377:c0b6fa74e007 35378:9144e898cad5
   871     maxvariantlength = max(len('format-variant'), maxvariantlength)
   871     maxvariantlength = max(len('format-variant'), maxvariantlength)
   872 
   872 
   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):
       
   877         if util.safehasattr(value, 'startswith'):
       
   878             return value
       
   879         if value:
       
   880             return 'yes'
       
   881         else:
       
   882             return 'no'
       
   883 
       
   884     fm = ui.formatter('debugformat', opts)
   876     fm = ui.formatter('debugformat', opts)
       
   877     if fm.isplain():
       
   878         def formatvalue(value):
       
   879             if util.safehasattr(value, 'startswith'):
       
   880                 return value
       
   881             if value:
       
   882                 return 'yes'
       
   883             else:
       
   884                 return 'no'
       
   885     else:
       
   886         formatvalue = pycompat.identity
       
   887 
   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')
   888     if ui.verbose:
   891     if ui.verbose:
   889         fm.plain(' config default')
   892         fm.plain(' config default')