qdiff: migrate to modern pager API
authorAugie Fackler <augie@google.com>
Mon, 06 Feb 2017 23:57:21 -0500
changeset 31033 861b070d92da
parent 31032 1cec1d863008
child 31034 270ab9d2ffbb
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.
hgext/mq.py
hgext/pager.py
--- a/hgext/mq.py	Mon Feb 06 22:59:25 2017 -0500
+++ b/hgext/mq.py	Mon Feb 06 23:57:21 2017 -0500
@@ -2676,6 +2676,7 @@
 
     Returns 0 on success.
     """
+    ui.pager('qdiff')
     repo.mq.diff(repo, pats, opts)
     return 0
 
--- a/hgext/pager.py	Mon Feb 06 22:59:25 2017 -0500
+++ b/hgext/pager.py	Mon Feb 06 23:57:21 2017 -0500
@@ -110,4 +110,6 @@
         extensions.wrapfunction(dispatch, '_runcommand', pagecmd)
     extensions.afterloaded('color', afterloaded)
 
-attended = ['qdiff']
+attended = [
+    'the-default-attend-list-is-now-empty-but-that-breaks-the-extension',
+]