Mercurial > hg
comparison hgext/pager.py @ 24066:afdf5f6ab37a
pager: set an attribute on ui indicating that a pager is active
A subsequent patch will teach the color extension to do different things
depending on whether a pager is active. This patch leaves a breadcrumb
on the ui instance to allow it do that that.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 06 Feb 2015 12:07:56 -0800 |
parents | bcddddcf0b54 |
children | 0baf41e02a4d |
comparison
equal
deleted
inserted
replaced
24065:d8837ad682dd | 24066:afdf5f6ab37a |
---|---|
147 if (cmd in attend or | 147 if (cmd in attend or |
148 (cmd not in ignore and not attend)): | 148 (cmd not in ignore and not attend)): |
149 usepager = True | 149 usepager = True |
150 break | 150 break |
151 | 151 |
152 setattr(ui, 'pageractive', usepager) | |
153 | |
152 if usepager: | 154 if usepager: |
153 ui.setconfig('ui', 'formatted', ui.formatted(), 'pager') | 155 ui.setconfig('ui', 'formatted', ui.formatted(), 'pager') |
154 ui.setconfig('ui', 'interactive', False, 'pager') | 156 ui.setconfig('ui', 'interactive', False, 'pager') |
155 if util.safehasattr(signal, "SIGPIPE"): | 157 if util.safehasattr(signal, "SIGPIPE"): |
156 signal.signal(signal.SIGPIPE, signal.SIG_DFL) | 158 signal.signal(signal.SIGPIPE, signal.SIG_DFL) |