Is extsetup() needed?
Yuya Nishihara
yuya at tcha.org
Sun Oct 25 12:48:26 UTC 2009
Hi,
Martin Geisler wrote:
> Yuya Nishihara <yuya at tcha.org> writes:
> > 2. uisetup -- fix own cmdtable if any
> > 3. extsetup -- wrap cmdtable of another extension and never modify own
> > cmdtable
> Yes, that is what I meant. The idea is that extension A can add things
> to its own cmdtable in A.uisetup so that B can always find it in
> B.extsetup. If A would add more stuff in A.extsetup, then B might or
> might not see it depending on the load order.
>
> > 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.
>
> I'm afraid I don't understand why you propose this change --- is it
> because you feel it simplifies the logic?
> I might have forgotten an old argument in the discussion, but I think it
> works okay now that we have the load-in-phases code in place. I suggest
> we leave it as it is at the moment. This API is for third-party tools,
> so we should not change it too often :-)
My point is that current implementation can be easily broken
because we can update cmdtable on extsetup() by mistake.
But I agreed we shouldn't change api due to such a small reason.
BTW, my original intention was just to fix hgweb's issue (issue1824).
I should better work on it.
Thanks.
More information about the Mercurial-devel
mailing list