Patchwork [4,of,9,pager,v2] ui: add ignore-single-command functionality

login
register
mail settings
Submitter Augie Fackler
Date Feb. 16, 2017, 4:59 p.m.
Message ID <90ee185e6c5e46d3e14a.1487264353@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/18551/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 16, 2017, 4:59 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1486441305 18000
#      Mon Feb 06 23:21:45 2017 -0500
# Node ID 90ee185e6c5e46d3e14a9c81539c6266941c8986
# Parent  2dcaa379926fbe6a5a3d628642ae61f363b500c4
ui: add ignore-single-command functionality

This closes the last feature gap other than the attend list from the
extension. For now, I'm leaving the attend list in the extension,
because I'm unsure it has merit in a world where commands have been
updated to take advantage of the modern API.

Patch

diff --git a/hgext/pager.py b/hgext/pager.py
--- a/hgext/pager.py
+++ b/hgext/pager.py
@@ -94,6 +94,12 @@  def uisetup(ui):
                     break
 
             if usepager:
+                # Slight hack: the attend list is supposed to override
+                # the ignore list for the pager extension, but the
+                # core code doesn't know about attend, so we have to
+                # lobotomize the ignore list so that the extension's
+                # behavior is preserved.
+                ui.setconfig('pager', 'ignore', '', 'pager')
                 ui.pager('extension-via-attend-' + cmd)
         return orig(ui, options, cmd, cmdfunc)
 
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -856,6 +856,7 @@  class ui(object):
         """
         if (self._neverpager
             or self.pageractive
+            or command in self.configlist('pager', 'ignore')
             # TODO: if we want to allow HGPLAINEXCEPT=pager,
             # formatted() will need some adjustment.
             or not self.formatted()