Mercurial > hg
comparison mercurial/streamclone.py @ 27797:054abf2377e8
lock: turn a lock into a Python context manager
This lets us greatly simply acquire/release cycles.
Code pattern before:
try:
lock = repo.lock()
# zillions of lines of code
finally:
lock.release()
And after:
with repo.lock():
# ...
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:45 -0800 |
parents | 9a1f3f9bac5d |
children | 7417e1c10253 |
comparison
equal
deleted
inserted
replaced
27796:f7f3958d39c0 | 27797:054abf2377e8 |
---|