Code review comment for lp:~henninge/bzr/bug-522195-contextmanagers

Revision history for this message
Robert Collins (lifeless) wrote :

I think I'd rather see these as helper functions, not mixins.

with read_locked(branch):

with write_locked(branch):

with tree_write_locked(tree):

helper functions are better in a few ways:
 - doesn't make the interface of Branch etc bigger
 - won't require plugins to be modified (that have implementations of
   Branch/Tree/Repository) to use these things
 - won't require test-per-Lockable, rather test-per-helper
 - keeps the concerns separate

Thanks for working on this.

 review: needsfixing

review: Needs Fixing

« Back to merge proposal