mercurial/streamclone.py
branchstable
changeset 28518 aa440c3d7c5d
parent 27897 2fdbf22a1b63
child 28532 ed75909c4c67
equal deleted inserted replaced
28517:95163ababeb8 28518:aa440c3d7c5d
   204                 if debugflag:
   204                 if debugflag:
   205                     repo.ui.debug('sending %s (%d bytes)\n' % (name, size))
   205                     repo.ui.debug('sending %s (%d bytes)\n' % (name, size))
   206                 # partially encode name over the wire for backwards compat
   206                 # partially encode name over the wire for backwards compat
   207                 yield '%s\0%d\n' % (store.encodedir(name), size)
   207                 yield '%s\0%d\n' % (store.encodedir(name), size)
   208                 if size <= 65536:
   208                 if size <= 65536:
   209                     yield svfs.read(name)
   209                     with svfs(name, 'rb') as fp:
       
   210                         yield fp.read(size)
   210                 else:
   211                 else:
   211                     for chunk in util.filechunkiter(svfs(name), limit=size):
   212                     for chunk in util.filechunkiter(svfs(name), limit=size):
   212                         yield chunk
   213                         yield chunk
   213         finally:
   214         finally:
   214             svfs.mustaudit = oldaudit
   215             svfs.mustaudit = oldaudit