[PATCH] patchbomb: respect HGPLAIN when piping --test output to PAGER

Yuya Nishihara yuya at tcha.org
Sun May 16 08:25:05 CDT 2010


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1274016194 -32400
# Node ID 985b9630064119a150e0e7b96ad14bf4b223b4c1
# Parent  358a737dd040e459c82c70bd511d8ce844b207c2
patchbomb: respect HGPLAIN when piping --test output to PAGER

It makes easy to use `hg email --test` from another tool.

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -450,7 +450,7 @@ def patchbomb(ui, repo, *revs, **opts):
         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


More information about the Mercurial-devel mailing list