Merge lp:~mbp/bzr/cleanup into lp:bzr
Proposed by
Martin Pool
Status: | Merged |
---|---|
Approved by: | Martin Pool |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5295 |
Proposed branch: | lp:~mbp/bzr/cleanup |
Merge into: | lp:bzr |
Diff against target: |
92 lines (+38/-14) 2 files modified
bzrlib/cleanup.py (+23/-14) bzrlib/tests/test_cleanup.py (+15/-0) |
To merge this branch: | bzr merge lp:~mbp/bzr/cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Bennetts | Approve | ||
Review via email: mp+24200@code.launchpad.net |
Commit message
add ObjectWithCleanups
Description of the change
This lets the cleanup code be used when the cleanups should be implicitly be done through some other operation on the object.
To post a comment you must log in.
Hmm. I think this is fine, although it feels half-done to me, because many objects that want cleanup management (e.g. Command, Commit) also want a robust way to run a method and then the cleanups.
So I'm ok with this landing if you find it useful for something, but I anticipate that it will soon grow some equivalent to the run method of OperationWithCl eanups too (or perhaps _do_with_cleanups will be promoted to a public function?). Also, the cleanup.py module docstring is pretty focused on the robust- run-with- cleanups use case, so perhaps if the scope is growing to more general cleanup-list management then the docstring should be updated to reflect that.