(extensions) Is it possible to add hook dynamically under TortoiseHg?

Yuya Nishihara yuya at tcha.org
Sat Apr 23 11:44:01 UTC 2016


On Sat, 23 Apr 2016 13:00:13 +0200, Marcin Kasperski wrote:
> >> https://www.mercurial-scm.org/wiki/WritingExtensions
> >> (chapter 10.1)  
> >
> > The wiki is misleading or doesn't mention why only pre/post-* hook can happen
> > to be set in uisetup(). (And that's why I said "in general".)  
> 
> Could you elaborate? As I said, under „normal mercurial” everything
> works perfectly.

It doesn't work on normal Mercurial command server. And you can't set the other
(no-dash) hooks and config values in uisetup(). That's why I said "In general,
you can't do ui.setconfig() in uisetup() and extsetup()." It only works if
the config value is processed in the dispatcher immediately after uisetup() is
called.

> The more I look at the things, the more I feel that TortoiseHg - if it
> is to handle extensions „like mercurial does” - should simply process
> hooks (at least pre- and post- hooks) on the „front side” of the
> things (before/after passing request to command server). But have to
> take some deeper looks before being sure ;-)

Again, it isn't TortoiseHg's fault. (I know TortoiseHg is likely to have more
bugs than Mercurial, but this issue isn't.) TortoiseHg just run commands over
the Mercurial command server. If you doubt, test without TortoiseHg.

https://www.mercurial-scm.org/wiki/CommandServer#Libraries



More information about the Mercurial mailing list