largefiles: add abstract methods in remotestore class
authorliscju <piotr.listkiewicz@gmail.com>
Thu, 10 Mar 2016 10:56:02 +0100
changeset 28442 3be2e89c5d9f
parent 28441 79d8e7926a04
child 28443 49d65663d7e4
largefiles: add abstract methods in remotestore class Methods _put, _get, _stat were used in remotestore class as abstract expecting that subclass would implement them. This commit makes this fact explicit.
hgext/largefiles/remotestore.py
--- a/hgext/largefiles/remotestore.py	Sun Feb 14 18:18:57 2016 +0100
+++ b/hgext/largefiles/remotestore.py	Thu Mar 10 10:56:02 2016 +0100
@@ -96,3 +96,18 @@
     def batch(self):
         '''Support for remote batching.'''
         return wireproto.remotebatch(self)
+
+    def _put(self, hash, fd):
+        '''Put file with the given hash in the remote store.'''
+        raise NotImplementedError('abstract method')
+
+    def _get(self, hash):
+        '''Get file with the given hash from the remote store.'''
+        raise NotImplementedError('abstract method')
+
+    def _stat(self, hashes):
+        '''Get information about availability of files specified by
+        hashes in the remote store. Return dictionary mapping hashes
+        to return code where 0 means that file is available, other
+        values if not.'''
+        raise NotImplementedError('abstract method')