Is extsetup() needed?

Brodie Rao dackze at gmail.com
Mon Oct 12 15:00:57 UTC 2009


On Oct 12, 2009, at 3:55 AM, Yuya Nishihara wrote:

> Hi, all.
>
> We have two similar functions to setup extension,
> uisetup() and extsetup().
>
> They're both called after loading all extensions, [1]_
> uisetup() is by extensions.loadall(), extsetup() by _dispatch().
> And they receive ui as an argument. [2]_
>
> Is extsetup() needed?
> At least, we can replace the appearance on hgext.record and  
> hgext.highlight
> by uisetup().
>
> .. [1] since http://hg.intevation.org/mercurial/crew/rev/1c83938b6a8e
>   [2] since http://hg.intevation.org/mercurial/crew/rev/8e6019b16a7d

Martin Geisler and I were chatting about this a while ago, and I think  
we both agreed that extsetup() should be deprecated. For compatibility  
reasons, I'm not sure it should be removed, but that extsetup(ui)  
patch in 3a78bbc57660 is silly and should be backed out (Martin?  
Anyone?).

Making those changes to record and highlight seems reasonable.

However, one thing to keep in mind is that any extension wanting to  
modify qrecord or any other command that's added in uisetup() will  
have problems doing so depending on the order of the extensions  
loaded. This is a separate issue from deprecating extsetup(), but it  
might be worth addressing as well. If I remember correctly, Martin and  
I discussed adding something like an extensions.wrapcommand() that  
would defer the wrapping until all extensions had been set up.



More information about the Mercurial-devel mailing list