patchbomb: respect HGPLAIN when piping --test output to PAGER
authorYuya Nishihara <yuya@tcha.org>
Sun, 16 May 2010 22:23:14 +0900
changeset 11183 b25464e9b448
parent 11181 6e65b451b62e
child 11184 7d99edddbaea
patchbomb: respect HGPLAIN when piping --test output to PAGER It makes easy to use `hg email --test` from another tool.
hgext/patchbomb.py
--- a/hgext/patchbomb.py	Sat May 15 21:24:23 2010 -0500
+++ b/hgext/patchbomb.py	Sun May 16 22:23:14 2010 +0900
@@ -450,7 +450,7 @@
         if opts.get('test'):
             ui.status(_('Displaying '), subj, ' ...\n')
             ui.flush()
-            if 'PAGER' in os.environ:
+            if 'PAGER' in os.environ and not ui.plain():
                 fp = util.popen(os.environ['PAGER'], 'w')
             else:
                 fp = ui