pager: ensure wrapped dispatch._runcommand runs before color's
An upcoming patch will teach color to potentially act differently if the
pager is active. Since both extensions wrap the same function
(dispatch._runcommand) to change behavior, we must guarantee that
pager's wrapped function runs before color's so color may read the
breadcrumb left by pager.
--- a/hgext/pager.py Fri Feb 06 12:07:56 2015 -0800
+++ b/hgext/pager.py Fri Feb 06 12:09:09 2015 -0800
@@ -159,7 +159,12 @@
_runpager(ui, p)
return orig(ui, options, cmd, cmdfunc)
- extensions.wrapfunction(dispatch, '_runcommand', pagecmd)
+ # Wrap dispatch._runcommand after color is loaded so color can see
+ # ui.pageractive. Otherwise, if we loaded first, color's wrapped
+ # dispatch._runcommand would run without having access to ui.pageractive.
+ def afterloaded(loaded):
+ extensions.wrapfunction(dispatch, '_runcommand', pagecmd)
+ extensions.afterloaded('color', afterloaded)
def extsetup(ui):
commands.globalopts.append(