[Zodb-checkins] SVN: ZODB/branches/3.4/src/transaction/ Remove
IRollBack -- it was premature.
Tim Peters
tim.one at comcast.net
Wed Apr 13 14:28:03 EDT 2005
Log message for revision 29961:
Remove IRollBack -- it was premature.
Changed:
U ZODB/branches/3.4/src/transaction/interfaces.py
U ZODB/branches/3.4/src/transaction/tests/abstestIDataManager.py
D ZODB/branches/3.4/src/transaction/tests/test_util.py
D ZODB/branches/3.4/src/transaction/util.py
-=-
Modified: ZODB/branches/3.4/src/transaction/interfaces.py
===================================================================
--- ZODB/branches/3.4/src/transaction/interfaces.py 2005-04-13 14:57:44 UTC (rev 29960)
+++ ZODB/branches/3.4/src/transaction/interfaces.py 2005-04-13 18:28:03 UTC (rev 29961)
@@ -269,19 +269,3 @@
synchronizer object via a TransactionManager's registerSynch() method
instead.
"""
-
-class IRollback(zope.interface.Interface):
-
- def rollback():
- """Rollback changes since savepoint.
-
- IOW, rollback to the last savepoint.
-
- It is an error to rollback to a savepoint if:
-
- - An earlier savepoint within the same transaction has been
- rolled back to, or
-
- - The transaction has ended.
- """
-
Modified: ZODB/branches/3.4/src/transaction/tests/abstestIDataManager.py
===================================================================
--- ZODB/branches/3.4/src/transaction/tests/abstestIDataManager.py 2005-04-13 14:57:44 UTC (rev 29960)
+++ ZODB/branches/3.4/src/transaction/tests/abstestIDataManager.py 2005-04-13 18:28:03 UTC (rev 29961)
@@ -31,7 +31,6 @@
"""
from unittest import TestCase
-from transaction.interfaces import IRollback
class IDataManagerTests(TestCase, object):
@@ -56,8 +55,3 @@
tran = self.get_transaction()
self.datamgr.prepare(tran)
self.datamgr.abort(tran)
-
- def testRollback(self):
- tran = self.get_transaction()
- rb = self.datamgr.savepoint(tran)
- self.assert_(IRollback.providedBy(rb))
Deleted: ZODB/branches/3.4/src/transaction/tests/test_util.py
===================================================================
--- ZODB/branches/3.4/src/transaction/tests/test_util.py 2005-04-13 14:57:44 UTC (rev 29960)
+++ ZODB/branches/3.4/src/transaction/tests/test_util.py 2005-04-13 18:28:03 UTC (rev 29961)
@@ -1,25 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Test transaction utilities
-
-$Id$
-"""
-import unittest
-from zope.testing.doctest import DocTestSuite
-
-def test_suite():
- return DocTestSuite('transaction.util')
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
Deleted: ZODB/branches/3.4/src/transaction/util.py
===================================================================
--- ZODB/branches/3.4/src/transaction/util.py 2005-04-13 14:57:44 UTC (rev 29960)
+++ ZODB/branches/3.4/src/transaction/util.py 2005-04-13 18:28:03 UTC (rev 29961)
@@ -1,51 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Utility classes or functions
-
-$Id$
-"""
-
-from transaction.interfaces import IRollback
-
-try:
- from zope.interface import implements
-except ImportError:
- def implements(*args):
- pass
-
-class NoSavepointSupportRollback:
- """Rollback for data managers that don't support savepoints
-
- >>> class DataManager:
- ... def savepoint(self, txn):
- ... return NoSavepointSupportRollback(self)
- >>> rb = DataManager().savepoint('some transaction')
- >>> rb.rollback()
- Traceback (most recent call last):
- ...
- NotImplementedError: """ \
- """DataManager data managers do not support """ \
- """savepoints (aka subtransactions
-
- """
-
- implements(IRollback)
-
- def __init__(self, dm):
- self.dm = dm.__class__.__name__
-
- def rollback(self):
- raise NotImplementedError(
- "%s data managers do not support savepoints (aka subtransactions"
- % self.dm)
More information about the Zodb-checkins
mailing list