--- a/mercurial/streamclone.py Fri Jan 15 13:14:50 2016 -0800
+++ b/mercurial/streamclone.py Fri Jan 15 13:14:50 2016 -0800
@@ -186,15 +186,12 @@
entries = []
total_bytes = 0
# Get consistent snapshot of repo, lock during scan.
- lock = repo.lock()
- try:
+ with repo.lock():
repo.ui.debug('scanning\n')
for name, ename, size in _walkstreamfiles(repo):
if size:
entries.append((name, size))
total_bytes += size
- finally:
- lock.release()
repo.ui.debug('%d files, %d bytes to transfer\n' %
(len(entries), total_bytes))