Comments
Patch
@@ -231,7 +231,8 @@ def copyfromcache(repo, hash, filename):
# don't use atomic writes in the working copy.
with open(path, 'rb') as srcfd:
with wvfs(filename, 'wb') as destfd:
- gothash = copyandhash(srcfd, destfd)
+ gothash = copyandhash(
+ util.filechunkiter(srcfd), destfd)
if gothash != hash:
repo.ui.warn(_('%s: data corruption in %s with hash %s\n')
% (filename, path, gothash))
@@ -10,6 +10,7 @@
from __future__ import absolute_import
from mercurial.i18n import _
+from mercurial import util
from . import (
basestore,
@@ -42,7 +43,8 @@ class localstore(basestore.basestore):
raise basestore.StoreError(filename, hash, self.url,
_("can't get file locally"))
with open(path, 'rb') as fd:
- return lfutil.copyandhash(fd, tmpfile)
+ return lfutil.copyandhash(
+ util.filechunkiter(fd), tmpfile)
def _verifyfiles(self, contents, filestocheck):
failed = False
@@ -118,7 +118,7 @@ class remotestore(basestore.basestore):
raise NotImplementedError('abstract method')
def _get(self, hash):
- '''Get file with the given hash from the remote store.'''
+ '''Get a iterator for content with the given hash.'''
raise NotImplementedError('abstract method')
def _stat(self, hashes):