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
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: Tree/Repository ) to use these things
- doesn't make the interface of Branch etc bigger
- won't require plugins to be modified (that have implementations of
Branch/
- won't require test-per-Lockable, rather test-per-helper
- keeps the concerns separate
Thanks for working on this.
review: needsfixing