Merge lp://staging/~spiv/bzr/just-add-repr-687653-2.2 into lp://staging/bzr/2.2

Proposed by Andrew Bennetts
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 5115
Proposed branch: lp://staging/~spiv/bzr/just-add-repr-687653-2.2
Merge into: lp://staging/bzr/2.2
Diff against target: 28 lines (+7/-0)
2 files modified
NEWS (+4/-0)
bzrlib/errors.py (+3/-0)
To merge this branch: bzr merge lp://staging/~spiv/bzr/just-add-repr-687653-2.2
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+43319@code.staging.launchpad.net

Commit message

Override __repr__ in NotBranchError to avoid side-effects during repr(e).

Description of the change

An simpler alternative to <https://code.launchpad.net/~mbp/bzr/687653-notbrancherror/+merge/43314>. Override __repr__ to make it simple and safe (instead of calling our custom _format which calls open_repository).

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

This is a nice minimal fix for 2.2, and apparently fixes the issue in production.

I think generally we shouldn't have any objects doing real work from their str or repr method, and exceptions should be a lot like value objects.

Perhaps we should have an optional ".hint()" method that the ui can call.

I am kind of inclined to delete this in trunk but it's not really a priority.

review: Approve
Revision history for this message
Andrew Bennetts (spiv) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches