[MERGE] Support for lazy registation of commands

Lukáš Lalinský lalinsky at gmail.com
Sat Aug 23 15:27:20 BST 2008


Dňa So, 2008-08-23 o 16:24 +0200, Lukáš Lalinský napísal:
> Hi,
> 
> how that QBzr is included by default in the Windows installer, I wanted
> to reduce the import overhead to minimum, so I wrote a function for lazy
> registration of commands. But the code was so simple that I decided to
> port it to bzrlib as well and submit a patch, as it might be useful for
> other plugins.
> 
> register_lazy_function takes the module and class names, and will import
> them only when necessary. It also takes the list of aliases for this
> command, because we can't loop this up without importing the command
> class.
> 
> If this patch will be accepted, I think it would make sense to split
> bzrlib.builtins and lazily register all the commands instead of
> importing the whole module on startup.

Sorry, I did some last-minute refacting and introduced bugs in the test
suite. Here is a fixed patch.

Lukas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: register-lazy-command.diff
Type: text/x-patch
Size: 8332 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080823/f60195bc/attachment.bin 


More information about the bazaar mailing list