[PATCH 2 of 7] color: initialize color for local peer ui

Yuya Nishihara yuya at tcha.org
Wed Mar 1 13:03:05 UTC 2017


On Tue, 28 Feb 2017 16:44:36 +0100, Pierre-Yves David wrote:
> On 02/28/2017 03:29 PM, Yuya Nishihara wrote:
> > On Tue, 28 Feb 2017 11:35:03 +0100, Pierre-Yves David wrote:
> >> On 02/28/2017 11:24 AM, Pierre-Yves David wrote:
> >>> On 02/28/2017 07:57 AM, Martin von Zweigbergk wrote:
> >>>> On Mon, Feb 27, 2017 at 6:59 AM, Pierre-Yves David
> >>>> <pierre-yves.david at ens-lyon.org> wrote:
> >>>>> # HG changeset patch
> >>>>> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> >>>>> # Date 1488044041 -3600
> >>>>> #      Sat Feb 25 18:34:01 2017 +0100
> >>>>> # Node ID c3224694bdae9cdb7530f952e2c767e419b7f280
> >>>>> # Parent  92526381242cd381375a465d5a800446916d2d7b
> >>>>> # EXP-Topic color
> >>>>> color: initialize color for local peer ui
> >>>>>
> >>>>> The local peer
> >>>>
> >>>> "local peer" or "localrepository"? The patch seems to be in "class
> >>>> localrepository".
> >>>
> >>> hum, good catch. Things seems clowner than I expected. It looks like we
> >>> don't use the "lui" (local ui, goes through uisetup) to create the
> >>> repository but the "baseui" (does not goes through uisetup).
> >>>
> >>> Let me grab a shovel and go bad into that code.
> >>
> >> Okay so in short "ui initialisation business is not simple". That
> >> description should be:
> >>
> >> color: initialize color for the localrepo ui
> >>
> >> The 'ui' object dedicated to a 'localrepo' is independant from the one
> >> available in dispatch (and 'uisetup'). In addition, it is created from
> >> the 'baseui' (for good reason apparently). For this reason, we need to
> >> run the color setup on it after the local repository config is read.
> >
> > Maybe we can move color.setup() to ui.fixconfig(), where ui attributes are
> > updated reflecting to config changes.
> 
> I considered it but it did not seemed appropriate. Fixconfig is run 
> quite often and the setup function is erasing most internal state 
> related to color. I was not confident make that change. I'm not saying 
> it is entirely impossible but that requires a careful review of the 
> setup process and other fixconfig related thing. So I would rather not 
> go this route for now. In particular, running during 'fixconfig' would 
> mean running it 'too early' before the extensions are loaded (they might 
> change the default style.

Good point and agreed.

It would be nice if we can get rid of the color dependency from localrepo
in future.


More information about the Mercurial-devel mailing list