[Zope-CVS] SVN: zversioning/trunk/src/versioning/__init__.py subsribe handler

Tobias Ahlers tobias.ahlers at web.de
Thu Oct 14 09:46:45 EDT 2004


Log message for revision 28181:
  subsribe handler

Changed:
  U   zversioning/trunk/src/versioning/__init__.py

-=-
Modified: zversioning/trunk/src/versioning/__init__.py
===================================================================
--- zversioning/trunk/src/versioning/__init__.py	2004-10-14 13:46:07 UTC (rev 28180)
+++ zversioning/trunk/src/versioning/__init__.py	2004-10-14 13:46:44 UTC (rev 28181)
@@ -1 +1,29 @@
-#make it a module
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""versioning package for zope3"""
+
+from versioning.interfaces import IVersionable
+from versioning.interfaces import IVersioned
+from versioning.interfaces import IHistoryStorage
+from versioning.interfaces import ICopyModifyMergeRepository
+from zope.app import zapi
+
+
+def registerVersionControl(event):
+    if IVersionable.providedBy(event.object):
+        history = zapi.getUtility(IHistoryStorage)
+        if history is not None and not IVersioned.providedBy(event.object):
+            rep = ICopyModifyMergeRepository(history)
+            get_transaction().commit()
+            rep.applyVersionControl(event.object)



More information about the Zope-CVS mailing list