changeset 31015:5e85bab867a7

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.
author Augie Fackler <augie@google.com>
date Mon, 06 Feb 2017 23:21:45 -0500
parents 3ed6e43998df
children cc3c9b6f1e09
files hgext/pager.py mercurial/ui.py
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/pager.py	Wed Feb 15 17:48:03 2017 -0500
+++ b/hgext/pager.py	Mon Feb 06 23:21:45 2017 -0500
@@ -94,6 +94,12 @@
                     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)
 
--- a/mercurial/ui.py	Wed Feb 15 17:48:03 2017 -0500
+++ b/mercurial/ui.py	Mon Feb 06 23:21:45 2017 -0500
@@ -851,6 +851,7 @@
         """
         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()