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

Marcin Kasperski Marcin.Kasperski at mekk.waw.pl
Fri Apr 22 23:27:26 UTC 2016


As an addendum.

Normal Mercurial:

- dispatch:_dispatch 
    calls 
        extensions.loadall(lui)
    and somehow later
         runcommand(lui, repo, …)

- runcommand
    calls pre-hooks USING lui to get their config
    calls _runcommand to actually execute (using ui to communicate)
    calls post-hooks again USING lui to get config

TortoiseHg:

-  run:runcommand
     calls extensions.loadall(lui)
     prepares command execution as closure on ui
     passess lui and that closure to _runcommand

- _runcommand:
     uses obtained lui (now named ui) only for profiling options
     executes command by closure

In addendum Tortoise monkeypatches mercurial.dispatch:_dispatch
but (unless I miss sth) doesn't seem too call it.

So it seems to mee that those pre- and post- hooks were simply dropped.
Feeling confused…




More information about the Mercurial mailing list