managing extensions

1 view
Skip to first unread message

Steve Borho

unread,
Aug 30, 2010, 2:45:54 PM8/30/10
to thg...@googlegroups.com
A big side-effect of adopting a multi-repo layout for the Workbench is
that we need a solution for per-repository extensions. In some ways,
this is simply impossible. Mercurial extensions are either loaded or
they are not loaded, we cannot be "a little pregnant". But we can do
a couple of things to mitigate this problem within the thgrepo class:

1) Each time a new thgrepo instance is created, or a repo ui is
invalidated, we must load all unloaded extensions
2) The thgrepo class needs an extensions() method that returns the
(cached) extensions enabled for that repo
3) thgrepo.extensions() should be used everywhere we check for an
extension being available for use.

There are probably more details to work through. I expect many
extensions assume repository objects are always created after the
extension has been loaded, to pick up patched/wrapped methods and
hooks. In fact, there's plenty of evidence hgtk doesn't do this right
for even the single repository case.

--
Steve Borho

Reply all
Reply to author
Forward
0 new messages