--- a/mercurial/streamclone.py Sat Jan 02 16:11:36 2016 -0800
+++ b/mercurial/streamclone.py Thu Jan 14 13:44:01 2016 -0800
@@ -298,7 +298,7 @@
start = time.time()
with repo.transaction('clone'):
- if True:
+ with repo.svfs.backgroundclosing(repo.ui, expectedcount=filecount):
for i in xrange(filecount):
# XXX doesn't support '\n' or '\r' in filenames
l = fp.readline()
@@ -312,7 +312,8 @@
repo.ui.debug('adding %s (%s)\n' %
(name, util.bytecount(size)))
# for backwards compat, name was partially encoded
- with repo.svfs(store.decodedir(name), 'w') as ofp:
+ path = store.decodedir(name)
+ with repo.svfs(path, 'w', backgroundclose=True) as ofp:
for chunk in util.filechunkiter(fp, limit=size):
handled_bytes += len(chunk)
repo.ui.progress(_('clone'), handled_bytes,