On 08/01/2010 09:33 AM, Yuya Nishihara wrote: > Kurt Granroth wrote: >> The problem is that the hooks are attached to the "wrong" UI object. >> >> Okay, so hgtk.run() calls 'extension.loadall(ui)'. This is the function >> that calls the extensions' uisetup()... and this is where the necessary >> hook is setup so that hgeol is called during the update. So far, so good. > > I don't read full story yet, but Mercurial also calls extensions.loadall() > with lui, which is copy of ui. (see dispatch.py:_dispatch().) > It means preupdate.eol hook doesn't take effect in most cases. > > in-hg-repo% hg update # doesn't call eol.preupdate() > out-hg-repo% hg clone foo bar # calls eol.preupdate() > in-hg-repo% hg clone . ../bar # doesn't call eol.preupdate() > > It's only effective for clone only when you're outside ouf repository.
I got almost exactly the *opposite* results of your test, in my earlier testing. That is, eol.preupdate() ran with 'hg update' but did not run with 'hg clone'. Actually, to be a bit more precise: hg clone *did* appear to work when the repositories were local (file://) but did not when the source repo was remote (ssh:// or http://). I don't think calling extensions.loadall() will do anything useful. The core extensions code uses a few global variables to ensure that hooks are only loaded once. ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Tortoisehg-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

