Patchwork [3,of,4] color: run slightly later during command dispatch

mail settings
Submitter Gregory Szorc
Date Feb. 4, 2015, 10:17 p.m.
Message ID <40cc0aa28ae26a651cc3.1423088232@gps-mbp.local>
Download mbox | patch
Permalink /patch/7675/
State Changes Requested
Headers show


Gregory Szorc - Feb. 4, 2015, 10:17 p.m.
# HG changeset patch
# User Gregory Szorc <>
# Date 1423087264 28800
#      Wed Feb 04 14:01:04 2015 -0800
# Node ID 40cc0aa28ae26a651cc33c8834afba4703a313c4
# Parent  f6866444b15b1bb1c5e24ea31660e1f8deb78a83
color: run slightly later during command dispatch

The next patch will introduce a run order dependency between pager and
color. Specifically, color's dispatch-time ui modification must occur
after pager has left its bread crumb saying a pager is active. We
prepare for this by having the color extension run during a separate
hook point during command dispatch to ensure it always runs after
pager's code.


diff --git a/hgext/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -508,9 +508,9 @@  def uisetup(ui):
                 # insert the argument in the front,
                 # the end of git diff arguments is used for paths
                 commands.insert(1, '--color')
         return orig(gitsub, commands, env, stream, cwd)
-    extensions.wrapfunction(dispatch, '_runcommand', colorcmd)
+    extensions.wrapfunction(dispatch, '_latefixupui', colorcmd)
     extensions.wrapfunction(subrepo.gitsubrepo, '_gitnodir', colorgit)
     templater.funcs['label'] = templatelabel
 def extsetup(ui):