Patchwork [1,of,4] pager: set an attribute on ui indicating that a pager is active

login
register
mail settings
Submitter Gregory Szorc
Date Feb. 4, 2015, 10:17 p.m.
Message ID <c1b76e9330b1f3934289.1423088230@gps-mbp.local>
Download mbox | patch
Permalink /patch/7673/
State Superseded
Commit afdf5f6ab37ae47611f6b24433de22b6e3b42980
Headers show

Comments

Gregory Szorc - Feb. 4, 2015, 10:17 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1423071588 28800
#      Wed Feb 04 09:39:48 2015 -0800
# Node ID c1b76e9330b1f39342899d8d53c3ddab388c3cb5
# Parent  e1dbe0b215ae137eec53ceb12440536d570a83d2
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 defines a breadcrumb
on the ui instance to allow it do that that.

Patch

diff --git a/hgext/pager.py b/hgext/pager.py
--- a/hgext/pager.py
+++ b/hgext/pager.py
@@ -148,8 +148,10 @@  def uisetup(ui):
                      (cmd not in ignore and not attend)):
                     usepager = True
                     break
 
+        setattr(ui, 'pageractive', usepager)
+
         if usepager:
             ui.setconfig('ui', 'formatted', ui.formatted(), 'pager')
             ui.setconfig('ui', 'interactive', False, 'pager')
             if util.safehasattr(signal, "SIGPIPE"):