Merge lp:~spiv/bzr/notbrancherror-recursion-2.2 into lp:bzr/2.2
| Status: | Merged |
|---|---|
| Approved by: | Martin Pool on 2010-10-11 |
| Approved revision: | 5101 |
| Merged at revision: | 5102 |
| Proposed branch: | lp:~spiv/bzr/notbrancherror-recursion-2.2 |
| Merge into: | lp:bzr/2.2 |
| Diff against target: |
54 lines (+22/-0) 3 files modified
NEWS (+4/-0) bzrlib/errors.py (+9/-0) bzrlib/tests/test_errors.py (+9/-0) |
| To merge this branch: | bzr merge lp:~spiv/bzr/notbrancherror-recursion-2.2 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Martin Pool | 2010-10-11 | Approve on 2010-10-11 | |
|
Review via email:
|
|||
Commit Message
Don't propagate unexpected exceptions during NotBranchError.
Description of the Change
This adds a bit of safety to NotBranchError. Tim Penhey encountered a situation where the Launchpad codehosting server would fall into an infinite loop because str() of a NotBranchError would trigger another NotBranchError.
Strictly speaking an infinite loop in that situation is a bug in the caller, but I don't see any harm in suppressing unexpected errors at that point. The open_repository call is only there to provide a hint in the str-ified error, and an error is enough to decide the hint isn't needed. And not obliterating the original error is likely to be more useful.
If we wanted to be extra conservative, we could just trap NotBranchError rather than Exception at that point, to only deal with the specific reported issue. But I think we may as well fix the slightly more general issue.
| Andrew Bennetts (spiv) wrote : | # |

sent to pqm by email