mercurial/streamclone.py
branchstable
changeset 28518 aa440c3d7c5d
parent 27897 2fdbf22a1b63
child 28532 ed75909c4c67
--- a/mercurial/streamclone.py	Sun Mar 13 02:28:46 2016 +0100
+++ b/mercurial/streamclone.py	Sun Mar 13 02:29:11 2016 +0100
@@ -206,7 +206,8 @@
                 # partially encode name over the wire for backwards compat
                 yield '%s\0%d\n' % (store.encodedir(name), size)
                 if size <= 65536:
-                    yield svfs.read(name)
+                    with svfs(name, 'rb') as fp:
+                        yield fp.read(size)
                 else:
                     for chunk in util.filechunkiter(svfs(name), limit=size):
                         yield chunk