[Zope-CVS] SVN: zversioning/trunk/src/versioning/ Some fixes
Uwe Oestermeier
uwe_oestermeier at iwm-kmrc.de
Wed Oct 13 11:49:33 EDT 2004
Log message for revision 28102:
Some fixes
Changed:
U zversioning/trunk/src/versioning/MOTIVATION.txt
U zversioning/trunk/src/versioning/README.txt
U zversioning/trunk/src/versioning/policies.py
U zversioning/trunk/src/versioning/tests/test_versioncontrol.py
-=-
Modified: zversioning/trunk/src/versioning/MOTIVATION.txt
===================================================================
--- zversioning/trunk/src/versioning/MOTIVATION.txt 2004-10-13 15:35:19 UTC (rev 28101)
+++ zversioning/trunk/src/versioning/MOTIVATION.txt 2004-10-13 15:49:32 UTC (rev 28102)
@@ -16,7 +16,6 @@
>>> import zope.app.versioncontrol.interfaces
>>> from zope.interface import directlyProvides
>>> from zope.app.versioncontrol.repository import declare_versioned
- >>> from versioning.tests.repository_setup import registerAdapter
>>> from zope.app.folder import Folder, rootFolder
>>> from zope.app.traversing.interfaces import IPhysicallyLocatable
>>> from ZODB.tests import util
@@ -47,7 +46,7 @@
In order to show some limitations of the current implementation we use a
prebuild version control repository :
- >>> from versioning.tests.repository_setup import buildRepository, buildDatabaseRoot
+ >>> from versioning.tests.test_versioncontrol import buildRepository, buildDatabaseRoot
>>> db_root = buildDatabaseRoot()
>>> db_root["sample"] = sample
>>> repository = buildRepository()
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 15:35:19 UTC (rev 28101)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-13 15:49:32 UTC (rev 28102)
@@ -13,15 +13,12 @@
|--> b |
|--> c
-
>>> import zope.app.versioncontrol.interfaces
>>> from zope.interface import directlyProvides
>>> from zope.app.folder import Folder, rootFolder
>>> from zope.app.tests.setup import setUpTraversal
>>> from zope.app.traversing.interfaces import IPhysicallyLocatable
>>> from ZODB.tests import util
- >>> registerAdapter()
- >>> setUpTraversal()
>>> class TestFolder(Folder) :
... zope.interface.implements(IPhysicallyLocatable)
... def getPath(self) :
@@ -37,7 +34,7 @@
>>> [x for x in sample.keys()]
[u'a', u'b']
- >>> from versioning.tests.repository_setup import buildRepository, buildDatabaseRoot
+ >>> from versioning.tests.test_versioncontrol import buildRepository, buildDatabaseRoot
>>> db_root = buildDatabaseRoot()
>>> db_root["sample"] = sample
@@ -104,7 +101,7 @@
So let us attach marker interfaces to the object before putting them
under version control:
- >>> from versioning.tests.repository_setup import instanceProvides
+ >>> from versioning.tests.test_versioncontrol import instanceProvides
>>> instanceProvides(sample, interfaces.IVersionable)
>>> instanceProvides(a, interfaces.IVersionable)
>>> instanceProvides(b, interfaces.IVersionable)
Modified: zversioning/trunk/src/versioning/policies.py
===================================================================
--- zversioning/trunk/src/versioning/policies.py 2004-10-13 15:35:19 UTC (rev 28101)
+++ zversioning/trunk/src/versioning/policies.py 2004-10-13 15:49:32 UTC (rev 28102)
@@ -66,7 +66,7 @@
the object history.
"""
# XXX we currently throw away the message
- history = self.histories.getHistory(self.versionable)
+ history = self.histories.getVersionHistory(self.versionable)
return IObjectCopier(self.versionable).copyTo(history)
def updateAspects(self, version_specifier) :
@@ -75,7 +75,7 @@
objects history.
"""
- history = self.histories.getHistory(self.versionable)
+ history = self.histories.getVersionHistory(self.versionable)
version = history[version_specifier]
self.copy(version, self.versionable)
@@ -95,8 +95,8 @@
paths this policy requires that external python
references are updated if needed.
"""
-
- def copy(self, source, target) :
+
+ def copy(self, source, target) :
""" Replaces the original with a copied version. """
parent = target.__parent__
Modified: zversioning/trunk/src/versioning/tests/test_versioncontrol.py
===================================================================
--- zversioning/trunk/src/versioning/tests/test_versioncontrol.py 2004-10-13 15:35:19 UTC (rev 28101)
+++ zversioning/trunk/src/versioning/tests/test_versioncontrol.py 2004-10-13 15:49:32 UTC (rev 28102)
@@ -91,6 +91,12 @@
def tearDown(test) :
placelesssetup.tearDown()
+
+def instanceProvides(obj, interface) :
+ """ Adds an interface to the directly provided ones of obj. """
+ ifaces = zope.interface.directlyProvidedBy(obj)
+ ifaces += interface
+ zope.interface.directlyProvides(obj, *ifaces)
def buildDatabaseRoot():
More information about the Zope-CVS
mailing list