--- BaseStorage.py_orig 2005-11-04 16:25:31.317090401 +0100 +++ BaseStorage.py 2005-11-04 15:32:32.359384462 +0100 @@ -275,11 +275,17 @@ """ return {} - def copyTransactionsFrom(self, other, verbose=0): + def copyTransactionsFrom(self, other, verbose=0, reset_tids=0): """Copy transactions from another storage. This is typically used for converting data from one storage to another. `other' must have an .iterator() method. + + reset_tids: If the timestamp of the last transaction is in the + future, new tids will be in the future, too. Packing will not + decrease the size of data.fs. If reset_tids is true, the + copy will create new tids from the current time. + See http://www.zope.org/Collectors/Zope/1861 """ _ts=None ok=1 @@ -319,7 +325,11 @@ if verbose: print _ts - self.tpc_begin(transaction, tid, transaction.status) + if reset_tids: + self.tpc_begin(transaction, None, transaction.status) + else: + self.tpc_begin(transaction, tid, transaction.status) + for r in transaction: oid=r.oid if verbose: print oid_repr(oid), r.version, len(r.data)