Code review comment for lp:~jelmer/bzr/lazy-bzrdir

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/10/2011 02:30 PM, Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr/lazy-bzrdir into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~jelmer/bzr/lazy-bzrdir/+merge/52844
>
> Make it possible to lazily register BzrDir and ControlDir formats.
>
> This is another prerequisite for the weave_fmt plugin branch. It also allows foreign formats to do more lazy loading - currently they always have to import their ControlDirFormat subclass at
> startup time to register it.
>
> Does the way in which this allows unregistration of lazy control dir formats look reasonable?
> I realize using:
>
> list.remove(_ObjectGetter(obj))
>
> and relying on the __eq__ implementation in _ObjectGetter is a bit weird, but I can't think of a better alternative. Better ideas welcome :)

I don't think we want a separate unregister_lazy_format, because at some
point, the format won't be lazy anymore. I'd rather have the
registration take some sort of 'key' that it can then use.

I'm guessing the regular "register_format" actually uses some attribute
of the format to determine if it is what it wants. Why not pass that in
to the "register_lazy_format" so that:

1) unregistering is more straightforward
2) we could skip loading it entirely if it doesn't match the key, even
if we are probing and think it 'might' fit.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk141V8ACgkQJdeBCYSNAAPuaQCgyY8q8owLfo+QyDKrjZjm7diD
rqkAoJpbD9no3Ij7C2p483gVPWBVud1u
=cznf
-----END PGP SIGNATURE-----

« Back to merge proposal