comparison mercurial/debugcommands.py @ 37823:0e9ddab2bac2 stable

debugcolor: fix crash by empty styles (issue5856)
author Yuya Nishihara <yuya@tcha.org>
date Thu, 26 Apr 2018 21:24:13 +0900
parents 89a16704114c
children d618558e4e8b 32bc3815efae
comparison
equal deleted inserted replaced
37822:da07c781aba9 37823:0e9ddab2bac2
460 for colorname, label in items: 460 for colorname, label in items:
461 ui.write(('%s\n') % colorname, label=label) 461 ui.write(('%s\n') % colorname, label=label)
462 462
463 def _debugdisplaystyle(ui): 463 def _debugdisplaystyle(ui):
464 ui.write(_('available style:\n')) 464 ui.write(_('available style:\n'))
465 if not ui._styles:
466 return
465 width = max(len(s) for s in ui._styles) 467 width = max(len(s) for s in ui._styles)
466 for label, effects in sorted(ui._styles.items()): 468 for label, effects in sorted(ui._styles.items()):
467 ui.write('%s' % label, label=label) 469 ui.write('%s' % label, label=label)
468 if effects: 470 if effects:
469 # 50 471 # 50