largefiles: fold oddly named _verify into remotestore.exists
authorMads Kiilerich <mads@kiilerich.com>
Fri, 08 Feb 2013 13:00:08 +0100
changeset 18573 003730ca254d
parent 18572 5fe58f9332a4
child 18574 4db9e31ae605
largefiles: fold oddly named _verify into remotestore.exists
hgext/largefiles/basestore.py
hgext/largefiles/remotestore.py
--- a/hgext/largefiles/basestore.py	Fri Feb 08 07:09:48 2013 -0600
+++ b/hgext/largefiles/basestore.py	Fri Feb 08 13:00:08 2013 +0100
@@ -43,7 +43,8 @@
         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):
--- a/hgext/largefiles/remotestore.py	Fri Feb 08 07:09:48 2013 -0600
+++ b/hgext/largefiles/remotestore.py	Fri Feb 08 13:00:08 2013 +0100
@@ -29,7 +29,7 @@
             _('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 @@
             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: