summary: use ui.label and join to write evolution troubles
Follow-up on
7b526670f540 to avoid a convoluted loop.
--- a/mercurial/commands.py Sat Jan 07 12:07:56 2017 +0100
+++ b/mercurial/commands.py Sat Jan 07 12:24:15 2017 +0100
@@ -5992,14 +5992,10 @@
else:
ui.write(_(' (no revision checked out)'))
if p.troubled():
- ui.write(' (')
- troubles = p.troubles()
- for idx, trouble in enumerate(troubles, 1):
- ui.write(trouble,
- label='trouble.%s' % trouble)
- if idx < len(troubles):
- ui.write(', ')
- ui.write(')')
+ ui.write(' ('
+ + ', '.join(ui.label(trouble, 'trouble.%s' % trouble)
+ for trouble in p.troubles())
+ + ')')
ui.write('\n')
if p.description():
ui.status(' ' + p.description().splitlines()[0].strip() + '\n',