Is extsetup() needed?

Yuya Nishihara yuya at tcha.org
Sat Oct 17 15:25:17 UTC 2009


Martin Geisler wrote:
> >> I guess it's not very clear from the wiki right now, but if
> >> extensions would add commands in uisetup and wrap other commands in
> >> extsetup, then they should always be able to find each other.
> >
> No, I'm talking about what we have currently:
> 
> 1. load extensions
> 2. uisetup -- wrap core Mercurial commands
> 3. extsetup -- wrap functions in other extensions
> 4. cmdtable
> 5. reposetup -- fiddle with repository
> 
> I think that should work, as long as no two extensions want to wrap each
> others functions.

Though it's unclear for me why we need to wrap extension's functions
after wrapping core's, maybe I got understood the meaning of the
previous message:

2. uisetup -- fix own cmdtable if any
3. extsetup -- wrap cmdtable of another extension and never modify own cmdtable

is this okay?

and if it's correct, how about the following?

2. uisetup -- fix own cmdtable
3. cmdtable -- load ext.cmdtable to commands.table
4. extsetup -- wrap commands.table

this can force modification of cmdtable at uisetup.


Yuya



More information about the Mercurial-devel mailing list