[PATCH] largefiles: add abstract methods in remotestore class

liscju piotr.listkiewicz at gmail.com
Thu Mar 10 04:57:53 EST 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1457603762 -3600
#      Thu Mar 10 10:56:02 2016 +0100
# Node ID 70232c60d7ec117a80e575290e37bc08e7c556ef
# Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
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.

diff -r c7f89ad87bae -r 70232c60d7ec hgext/largefiles/remotestore.py
--- a/hgext/largefiles/remotestore.py	Mon Feb 29 17:52:17 2016 -0600
+++ b/hgext/largefiles/remotestore.py	Thu Mar 10 10:56:02 2016 +0100
@@ -96,3 +96,18 @@ class remotestore(basestore.basestore):
     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')


More information about the Mercurial-devel mailing list