Commit e491060e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add Storage.importFrom() API to import only a part of a storage.

git-svn-id: 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 90b46901
......@@ -137,7 +137,14 @@ class Storage(BaseStorage.BaseStorage,
def copyTransactionsFrom(self, source, verbose=False):
return, self.tryToResolveConflict)
""" Zope compliant API """
return, None, None,
def importFrom(self, source, start=None, stop=None):
""" Allow import only a part of the source storage """
return, start, stop,
def restore(self, oid, serial, data, version, prev_txn, transaction):
raise NotImplementedError
......@@ -1015,7 +1015,7 @@ class Application(object):
return history_list
def copyTransactionsFrom(self, source, tryToResolveConflict):
def importFrom(self, source, start, stop, tryToResolveConflict):
serials = {}
def updateLastSerial(oid, result):
if result:
......@@ -1026,7 +1026,7 @@ class Application(object):
for oid, serial in result:
assert isinstance(serial, str), serial
serials[oid] = serial
transaction_iter = source.iterator()
transaction_iter = source.iterator(start, stop)
for transaction in transaction_iter:
self.tpc_begin(transaction, transaction.tid, transaction.status)
for r in transaction:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment