comparison hgext/patchbomb.py @ 23173:122f5c3f3308

patchbomb: add label and color to the confirm output The current output is mostly a wall of text. This makes it hard to actually check something for people with lazy eyes. We use labels and colors to make it more joyful (and get the patch summaries to stand out). The colors have been arbitrarily choosen. They can be changed later if someone has a more scientific choice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 04 Nov 2014 13:38:33 +0000
parents 5f98ad8fb8d9
children 79f7444520bf
comparison
equal deleted inserted replaced
23172:e955549cd045 23173:122f5c3f3308
481 cc = getaddrs('Cc', ask=True, default='') or [] 481 cc = getaddrs('Cc', ask=True, default='') or []
482 bcc = getaddrs('Bcc') or [] 482 bcc = getaddrs('Bcc') or []
483 replyto = getaddrs('Reply-To') 483 replyto = getaddrs('Reply-To')
484 484
485 if opts.get('diffstat') or opts.get('confirm'): 485 if opts.get('diffstat') or opts.get('confirm'):
486 ui.write(_('\nFinal summary:\n\n')) 486 ui.write(_('\nFinal summary:\n\n'), label='patchbomb.finalsummary')
487 ui.write(('From: %s\n' % sender)) 487 ui.write(('From: %s\n' % sender), label='patchbomb.from')
488 for addr in showaddrs: 488 for addr in showaddrs:
489 ui.write('%s\n' % addr) 489 ui.write('%s\n' % addr, label='patchbomb.to')
490 for m, subj, ds in msgs: 490 for m, subj, ds in msgs:
491 ui.write(('Subject: %s\n' % subj)) 491 ui.write(('Subject: %s\n' % subj), label='patchbomb.subject')
492 if ds: 492 if ds:
493 ui.write(ds) 493 ui.write(ds, label='patchbomb.diffstats')
494 ui.write('\n') 494 ui.write('\n')
495 if ui.promptchoice(_('are you sure you want to send (yn)?' 495 if ui.promptchoice(_('are you sure you want to send (yn)?'
496 '$$ &Yes $$ &No')): 496 '$$ &Yes $$ &No')):
497 raise util.Abort(_('patchbomb canceled')) 497 raise util.Abort(_('patchbomb canceled'))
498 498