--- a/mercurial/streamclone.py Fri Jan 15 13:14:49 2016 -0800
+++ b/mercurial/streamclone.py Fri Jan 15 13:14:49 2016 -0800
@@ -137,8 +137,7 @@
raise error.ResponseError(
_('unexpected response from remote server:'), l)
- lock = repo.lock()
- try:
+ with repo.lock():
consumev1(repo, fp, filecount, bytecount)
# new requirements = old non-format requirements +
@@ -153,8 +152,6 @@
branchmap.replacecache(repo, rbranchmap)
repo.invalidate()
- finally:
- lock.release()
def allowservergeneration(ui):
"""Whether streaming clones are allowed from the server."""