Discussed changes

Gustavo Niemeyer gustavo at niemeyer.net
Thu Aug 18 15:14:55 BST 2005


Hey Martin,

> Suppose there are two versions of a plugin installed, one globally and
> one in the home directory.
> 
> Obviously we want the users' own one to take priority.  It might cause
> trouble to load two things that both run similar initialization code,
> and I don't see why it'd be very useful.

In that case you're supposing that those two plugins do exactly
the same thing, as is the case of the changeset plugin mentioned
by Aaron. But I don't think this will always be the case.

> So I suggest we search a path starting with the home directory.  Once
> a name has been seen, it's not loaded again if it's found somewhere
> else.   The pattern is similar to python imports, which is good.

This is nice for a system like Python's import, where you're looking
for a specific name requested by the user. This could also be
interesting when handling a command infrastrucutre, since we really
are looking for a "name" (a command name). But for generic plugins
which are supposed to register themselves wherever they want, I don't
think this is a good idea.

Just load all of them in PATH order, and leave them registering
wherever needed. In places that have a "key", like command
registration, the last registered one wins. That's the least
surprising outcome, I belive.

Best regards,

-- 
Gustavo Niemeyer
http://niemeyer.net




More information about the bazaar mailing list