patchbomb: add label and color to the confirm output
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 04 Nov 2014 13:38:33 +0000
changeset 23173 122f5c3f3308
parent 23172 e955549cd045
child 23174 7041b7120e69
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.
hgext/color.py
hgext/patchbomb.py
--- a/hgext/color.py	Tue Nov 04 23:41:46 2014 +0900
+++ b/hgext/color.py	Tue Nov 04 13:38:33 2014 +0000
@@ -301,6 +301,11 @@
            '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',
--- a/hgext/patchbomb.py	Tue Nov 04 23:41:46 2014 +0900
+++ b/hgext/patchbomb.py	Tue Nov 04 13:38:33 2014 +0000
@@ -483,14 +483,14 @@
     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')):