largefiles: fold oddly named _verify into remotestore.exists

This commit is contained in:
Mads Kiilerich 2013-02-08 13:00:08 +01:00
parent 5c8acaf5b4
commit e9a72ba5f1
2 changed files with 3 additions and 5 deletions

View File

@ -43,7 +43,8 @@ class basestore(object):
raise NotImplementedError('abstract method')
def exists(self, hashes):
'''Check to see if the store contains the given hashes.'''
'''Check to see if the store contains the given hashes. Given an
iterable of hashes it returns a mapping from hash to bool.'''
raise NotImplementedError('abstract method')
def get(self, files):

View File

@ -29,7 +29,7 @@ class remotestore(basestore.basestore):
_('remotestore: put %s to remote store %s') % (source, self.url))
def exists(self, hashes):
return self._verify(hashes)
return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
def sendfile(self, filename, hash):
self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash))
@ -76,9 +76,6 @@ class remotestore(basestore.basestore):
infile = lfutil.limitreader(infile, length)
return lfutil.copyandhash(lfutil.blockstream(infile), tmpfile)
def _verify(self, hashes):
return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
def _verifyfile(self, cctx, cset, contents, standin, verified):
filename = lfutil.splitstandin(standin)
if not filename: