Merge lp:~mbp/bzr/lazy-commands into lp:bzr
Proposed by
Martin Pool
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~mbp/bzr/lazy-commands |
Merge into: | lp:bzr |
Diff against target: |
244 lines (+72/-28) 4 files modified
bzrlib/builtins.py (+0/-8) bzrlib/commands.py (+60/-16) bzrlib/tests/test_commands.py (+3/-4) bzrlib/tests/test_import_tariff.py (+9/-0) |
To merge this branch: | bzr merge lp:~mbp/bzr/lazy-commands |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Review via email: mp+21910@code.launchpad.net |
Commit message
(mbp) allow builtin commands to be lazy loaded; make bundle-info lazy
Description of the change
This allows builtin commands to be lazy-loaded and makes bundle-info so.
CommandRegistry needs to handle aliases itself, rather than constructing a
command instance to look them up, because doing so implies loading the
implementation.
_builtin_commands (previously private) is deprecated.
More can be done but I thought I'd put this up for review.
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/lazy-commands into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> This allows builtin commands to be lazy-loaded and makes bundle-info so.
>
> CommandRegistry needs to handle aliases itself, rather than constructing a
> command instance to look them up, because doing so implies loading the
> implementation.
>
> _builtin_commands (previously private) is deprecated.
>
> More can be done but I thought I'd put this up for review.
>
This looks good to me. It would be nice to have explicit tests on
aliases/lazily imported commands/overriding lazy commands. However, at
least forcing one command to be lazy is good. It would probably be
better to make it a commonly used command (bzr st), so that devs would
get active use out of it. That can be the next step, though.
I wonder if explicitly registering is better than trying to 'import from
XXX' if you want command XXX. Certainly plugins still need to register,
and registering for stuff that they override is tricker in those
circumstances.
Anyway, this is going to be better than what we have. I just wonder if
it is going to get us the best result.
John
=:->
merge: approve enigmail. mozdev. org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAku o62sACgkQJdeBCY SNAAO66gCfWgc8r OYyNWoQfBrt/ iDWWxIR l7WO7y14qrztGso ER
AQcAoKagEZjZnP7
=sw27
-----END PGP SIGNATURE-----