[Zope-CVS] CVS: Products/ZopeVersionControl - Version.py:1.3 VersionHistory.py:1.2
Brian Lloyd
brian@digicool.com
Thu, 25 Oct 2001 16:36:50 -0400
Update of /cvs-repository/Products/ZopeVersionControl
In directory cvs.zope.org:/tmp/cvs-serv15204
Modified Files:
Version.py VersionHistory.py
Log Message:
Fixed bug in state copying (no _p_jar for Version when state is copied)
=== Products/ZopeVersionControl/Version.py 1.2 => 1.3 ===
)
- def __init__(self, id, object):
+ def __init__(self, id, object, parent):
self.id = id
self.meta = ObjectMetadata(object)
- self.saveState(object)
+ self.saveState(object, parent)
# xxx - fix this
self.records = []
# self.co_state = PersistentMapping()
@@ -93,10 +93,12 @@
object._p_jar = ReadOnlyJar(object._p_jar)
return object
- def saveState(self, object):
+ def saveState(self, object, parent):
baseobj = Acquisition.aq_base(object)
# xxx - fix this!
- obcopy = object._getCopy(object)
+# obcopy = object._getCopy(object)
+ obcopy = object._getCopy(parent)
+
obcopy.__non_versionable__ = 1
self.data = obcopy
return
=== Products/ZopeVersionControl/VersionHistory.py 1.1 => 1.2 ===
def createVersion(self, object):
ver_id = self.nextVersionId(object)
- version = Version(ver_id, object)
+ version = Version(ver_id, object, self)
self._setObject(ver_id, version)
return self.getVersion(ver_id)