[Checkins] SVN: relstorage/trunk/relstorage/storage.py Let me be evil and pass in an existing iterator (with a predetermined start).

Martijn Pieters mj at zopatista.com
Wed Sep 7 08:25:24 EST 2011


Log message for revision 122740:
  Let me be evil and pass in an existing iterator (with a predetermined start).

Changed:
  U   relstorage/trunk/relstorage/storage.py

-=-
Modified: relstorage/trunk/relstorage/storage.py
===================================================================
--- relstorage/trunk/relstorage/storage.py	2011-09-07 09:53:34 UTC (rev 122739)
+++ relstorage/trunk/relstorage/storage.py	2011-09-07 13:25:23 UTC (rev 122740)
@@ -1323,7 +1323,10 @@
         txnum = 0
         total_size = 0
         log.info("Counting the transactions to copy.")
-        num_txns = len(list(other.iterator()))
+        if isinstance(other, TransactionIterator):
+            num_txns = len(other)
+        else:
+            num_txns = len(list(other.iterator()))
         log.info("Copying the transactions.")
         for trans in other.iterator():
             txnum += 1



More information about the checkins mailing list