Patchwork [05,of,19,pager] qdiff: migrate to modern pager API

login
register
mail settings
Submitter Augie Fackler
Date Feb. 19, 2017, 11:12 p.m.
Message ID <047682a5c9af676f0ac0.1487545976@imladris.local>
Download mbox | patch
Permalink /patch/18660/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 19, 2017, 11:12 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1486443441 18000
#      Mon Feb 06 23:57:21 2017 -0500
# Node ID 047682a5c9af676f0ac0e8169715f4e0b29f3dc0
# Parent  173c95da11848036895410797f8228c6562ce1d3
qdiff: migrate to modern pager API

This results in the default pager-attend list being empty. Sadly, we
can't let the code be that way, because some legacy extensions depend
on hooking the pager's attend list at import time (and we'd like to
not break them), and if the list is actually *empty* that triggers
magic behavior in the extension that attends everything. Instead, we
put a long, improbable command name as the only entry in the attend
list.

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2675,6 +2675,7 @@  def diff(ui, repo, *pats, **opts):
 
     Returns 0 on success.
     """
+    ui.pager('qdiff')
     repo.mq.diff(repo, pats, opts)
     return 0
 
diff --git a/hgext/pager.py b/hgext/pager.py
--- a/hgext/pager.py
+++ b/hgext/pager.py
@@ -110,4 +110,6 @@  def uisetup(ui):
         extensions.wrapfunction(dispatch, '_runcommand', pagecmd)
     extensions.afterloaded('color', afterloaded)
 
-attended = ['qdiff']
+attended = [
+    'the-default-attend-list-is-now-empty-but-that-breaks-the-extension',
+]