# HG changeset patch # User Pierre-Yves David # Date 2014-11-04 13:38:33 # Node ID 122f5c3f3308f547dd21e4c3de48831210091d1a # Parent e955549cd0452758ea8ff65f4a50a96605f62f48 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. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -301,6 +301,11 @@ except ImportError: 'histedit.remaining': 'red bold', 'ui.prompt': 'yellow', 'log.changeset': 'yellow', + 'patchbomb.finalsummary': '', + 'patchbomb.from': 'magenta', + 'patchbomb.to': 'cyan', + 'patchbomb.subject': 'green', + 'patchbomb.diffstats': '', 'rebase.rebased': 'blue', 'rebase.remaining': 'red bold', 'resolve.resolved': 'green bold', diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -483,14 +483,14 @@ def patchbomb(ui, repo, *revs, **opts): replyto = getaddrs('Reply-To') if opts.get('diffstat') or opts.get('confirm'): - ui.write(_('\nFinal summary:\n\n')) - ui.write(('From: %s\n' % sender)) + ui.write(_('\nFinal summary:\n\n'), label='patchbomb.finalsummary') + ui.write(('From: %s\n' % sender), label='patchbomb.from') for addr in showaddrs: - ui.write('%s\n' % addr) + ui.write('%s\n' % addr, label='patchbomb.to') for m, subj, ds in msgs: - ui.write(('Subject: %s\n' % subj)) + ui.write(('Subject: %s\n' % subj), label='patchbomb.subject') if ds: - ui.write(ds) + ui.write(ds, label='patchbomb.diffstats') ui.write('\n') if ui.promptchoice(_('are you sure you want to send (yn)?' '$$ &Yes $$ &No')):