[Zope-CVS] SVN: zversioning/trunk/src/versioning/README.txt
another(2) intermediate version
Grégoire Weber
zope.org at incept.ch
Wed Oct 13 09:52:58 EDT 2004
Log message for revision 28079:
another(2) intermediate version
Changed:
U zversioning/trunk/src/versioning/README.txt
-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 13:32:32 UTC (rev 28078)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-13 13:52:57 UTC (rev 28079)
@@ -55,6 +55,7 @@
usually does for us):
>>> from zope.app.tests import ztapi
+ >>> from zope.app import zapi
>>> from versioning import interfaces, repository, policies, storage
Configure the 'IHistoryStorage' utility being responsible for the storage
@@ -62,6 +63,8 @@
>>> ztapi.provideUtility(interfaces.IHistoryStorage,
... storage.SimpleHistoryStorage())
+
+ >>> histories_storage = zapi.getUtility(interfaces.IHistoryStorage)
We also need a 'IVersionableAspects' multi adapter beeing responsible
for the versioning policy (what is versioned and how (not storage)).
@@ -78,11 +81,18 @@
... interfaces.IHistoryStorage,
... repository.DummyCheckoutAware)
-Let's now build the repository:
+In this implementation the repository is simply a adapter to a
+'IHistoryStorage'. This ensures that several versioning strategies
+can be used with the same storage:
- >>> from versioning.repository import CopyModifyMergeRepository
- >>> repository = buildRepository(CopyModifyMergeRepository)
+ >>> ztapi.provideAdapter(interfaces.IHistoryStorage,
+ ... interfaces.ICopyModifyMergeRepository,
+ ... repository.CopyModifyMergeRepository)
+Now we adapt our history storage to the chosen repository strategy:
+
+ >>> repository = interfaces.ICopyModifyMergeRepository(histories_storage)
+
An object that isn't 'IVersionable' can't be put under version control.
Applying version control should raise an exception:
More information about the Zope-CVS
mailing list