[Checkins] SVN: zodbupdate/trunk/ - Remove superfluous code that tried to prevent commits when no changes

Christian Theune ct at gocept.com
Wed Jun 24 11:25:05 EDT 2009


Log message for revision 101267:
  - Remove superfluous code that tried to prevent commits when no changes
    happened: ZODB does this all by itself already.
  

Changed:
  U   zodbupdate/trunk/CHANGES.txt
  U   zodbupdate/trunk/src/zodbupdate/tests.py
  U   zodbupdate/trunk/src/zodbupdate/update.py

-=-
Modified: zodbupdate/trunk/CHANGES.txt
===================================================================
--- zodbupdate/trunk/CHANGES.txt	2009-06-24 15:15:56 UTC (rev 101266)
+++ zodbupdate/trunk/CHANGES.txt	2009-06-24 15:25:05 UTC (rev 101267)
@@ -4,7 +4,8 @@
 0.3 (unreleased)
 ----------------
 
-- ...
+- Remove superfluous code that tried to prevent commits when no changes
+  happened: ZODB does this all by itself already.
 
 0.2 (2009-06-23)
 ----------------

Modified: zodbupdate/trunk/src/zodbupdate/tests.py
===================================================================
--- zodbupdate/trunk/src/zodbupdate/tests.py	2009-06-24 15:15:56 UTC (rev 101266)
+++ zodbupdate/trunk/src/zodbupdate/tests.py	2009-06-24 15:25:05 UTC (rev 101267)
@@ -172,7 +172,6 @@
         # transaction to avoid superfluous clutter in the DB.
         last = self.storage.lastTransaction()
         updater = self.update()
-        self.assertEquals(0, updater.changes)
         self.assertEquals(last, self.storage.lastTransaction())
         self.assertEquals({}, updater.renames)
 

Modified: zodbupdate/trunk/src/zodbupdate/update.py
===================================================================
--- zodbupdate/trunk/src/zodbupdate/update.py	2009-06-24 15:15:56 UTC (rev 101266)
+++ zodbupdate/trunk/src/zodbupdate/update.py	2009-06-24 15:25:05 UTC (rev 101267)
@@ -36,8 +36,6 @@
         self.missing = set()
         self.renames = renames or {}
 
-        self.changes = 0
-
     def __call__(self):
         t = transaction.Transaction()
         self.storage.tpc_begin(t)
@@ -49,14 +47,10 @@
                 continue
             logger.debug('Updated %s' % ZODB.utils.oid_repr(oid))
             self.storage.store(oid, serial, new, '', t)
-            self.changes += 1
 
         if self.dry:
             logger.info('Dry run selected, aborting transaction.')
             self.storage.tpc_abort(t)
-        elif not self.changes:
-            logger.info('No changes, aborting transaction.')
-            self.storage.tpc_abort(t)
         else:
             logger.info('Committing changes.')
             self.storage.tpc_vote(t)



More information about the Checkins mailing list