Merge lp:~mbp/bzr/491763-transform-rename-failed into lp:bzr
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Vincent Ladeuil on 2010-05-12 | ||||
| Approved revision: | 5197 | ||||
| Merged at revision: | 5228 | ||||
| Proposed branch: | lp:~mbp/bzr/491763-transform-rename-failed | ||||
| Merge into: | lp:bzr | ||||
| Diff against target: |
215 lines (+57/-37) 7 files modified
bzrlib/errors.py (+11/-0) bzrlib/osutils.py (+2/-20) bzrlib/tests/test_errors.py (+6/-0) bzrlib/tests/test_osutils.py (+0/-7) bzrlib/tests/test_transform.py (+26/-0) bzrlib/transform.py (+10/-5) bzrlib/transport/local.py (+2/-5) |
||||
| To merge this branch: | bzr merge lp:~mbp/bzr/491763-transform-rename-failed | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Vincent Ladeuil | 2010-04-30 | Approve on 2010-05-12 | |
| Martin Packman (community) | Abstain on 2010-05-06 | ||
|
Review via email:
|
|||
Commit Message
(mbp) better message when rename fails inside TreeTransform
Description of the Change
Here's another attempt that changes transform more specifically. It would still be useful to do this in LocalTransport.
| Robert Collins (lifeless) wrote : | # |
| Martin Packman (gz) wrote : | # |
See the mailing list for general comments, specifics on this change below.
+ _fmt = "Failed to rename %(from_path)s to %(to_path)s: %(why)s"
As mentioned on list, `from_path` and `to_path` can be unicode and `why` can be a non-ascii bytestring. With BzrError subclasses we get "Unprintable exception..." rather than a total failure at least, but that's untested.
- except OSError, e:
+ except (IOError, OSError), e:
Presume this is because osutils.rename is fancy_rename on windows, that has code dealing with IOError inside? It's not clear to me it'll actually be raised here, as it's just using the standard os.rename and os.unlink functions.
+ raise errors.
When wrapping exceptions, passing the actual object is better than just the stringified version. Can safely format an exception object for output, can't say that for arbitrary bytestrings.
+ raise errors.
Trailing whitespace.
This version is less fragile than the last one, but I don't really like changing the exception type unless you're sure those two except clauses in bzrlib.transform is the only code that cares.
| Vincent Ladeuil (vila) wrote : | # |
bzr.dev: http://
this proposal: http://
Martin [gz] and I would have preferred an automated vote for this, but hey, that's a huge progress :)
| Vincent Ladeuil (vila) wrote : | # |
Remember you've seen it here first !
One day, babune may vote Approve :)
| Robert Collins (lifeless) wrote : | # |
submitted to PQM by hand.
- 5198. By Martin Pool on 2010-05-13
-
Remove obsolete error
| Martin Pool (mbp) wrote : | # |
sent to pqm by email

Looks pretty good to me. Martin[gz] ?