Merge lp:~vila/bzr/917733-cmdline-overrides into lp:bzr/2.5
| Status: | Merged |
|---|---|
| Approved by: | Martin Packman on 2012-01-19 |
| Approved revision: | 6445 |
| Merged at revision: | 6445 |
| Proposed branch: | lp:~vila/bzr/917733-cmdline-overrides |
| Merge into: | lp:bzr/2.5 |
| Diff against target: |
40 lines (+11/-2) 2 files modified
bzrlib/commands.py (+8/-2) doc/en/release-notes/bzr-2.5.txt (+3/-0) |
| To merge this branch: | bzr merge lp:~vila/bzr/917733-cmdline-overrides |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Martin Packman (community) | 2012-01-19 | Approve on 2012-01-19 | |
|
Review via email:
|
|||
Commit Message
Support scripts that don't call bzrlib.initialize() but still call run_bzr()
Description of the Change
Low-risk fix for scripts that, despite calling run_bzr, don't call
bzrlib.intialize().
The long term fix is to properly support this use case which is more
invasive and may require discussion. I've discussed a plan at the rally last
week to get there and will work on that shortly (I need some support from
library_state too for caching local config files targetting a fix for
http://
| Vincent Ladeuil (vila) wrote : | # |
| Martin Packman (gz) wrote : | # |
Looks fine, I'd add a comment before the `global_state is None` check saying what's up.
# Reset the overrides
- bzrlib.
+ cmdline_
Why is this here, rather than in LibraryState.
| Vincent Ladeuil (vila) wrote : | # |
> Looks fine, I'd add a comment before the `global_state is None` check saying
> what's up.
I'll do.
>
> # Reset the overrides
> - bzrlib.
> + cmdline_
>
> Why is this here, rather than in LibraryState.
> to have the same lifetime as the process, it shouldn't be using global_state
> at all.
Mostly because we should *receive* a library state object there. But this requires a bit more care and will be more invasive.
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
- 6446. By Vincent Ladeuil on 2012-01-19
-
Clarifying why we need to workaround bzrlib.initialize() not being called.

Tested manually with:
#!/usr/bin/python
import bzrlib
from bzrlib import commands
commands. _register_ builtin_ commands( ) install_ bzr_command_ hooks() run_bzr( ['rocks' ])
commands.
import pdb; pdb.set_trace()
commands.
Traceback without the fix, works with it.
No output as the default UI is SilentUIFactory (tarmac uses a more complex setup but will use the same code path in the end).