[Zope3-checkins] CVS: Zope3/src/zodb - conflict.py:1.16

Jim Fulton jim at zope.com
Sun Sep 21 13:29:56 EDT 2003


Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv11510/src/zodb

Modified Files:
	conflict.py 
Log Message:
Done by Jeremy on the parentgeddon-branch branch:

Change conflict-resolution to no longer use a proxy. This is
necessary to support persistent proxies.


=== Zope3/src/zodb/conflict.py 1.15 => 1.16 ===
--- Zope3/src/zodb/conflict.py:1.15	Thu Jun 19 17:41:10 2003
+++ Zope3/src/zodb/conflict.py	Sun Sep 21 13:29:56 2003
@@ -28,34 +28,6 @@
 
 ResolvedSerial = "rs"
 
-class ResolvedObjectAdapter:
-    """Adapt an object's raw state to the ObjectWriter protocol.
-
-    ObjectWriter uses an object's __class__ and __getstate__() method
-    to determine how to pickle it.  When conflict resolution occurs,
-    there is no instantiated object; the code deals with the concrete
-    state as returned by __getstate__().  This adapter allows the
-    state to be passed to ObjectWriter without instantiating the
-    object.
-
-    This object should only be used in conjunction with the ObjectWriter.
-    """
-
-    def __init__(self, ghost, state):
-        self._class = ghost.__class__
-        self._state = state
-        self._p_state = 0 # required to make getClassMetadata() happy
-
-    def __getattribute__(self, name):
-        if name == "__class__":
-            return self._class
-        else:
-            _super = super(ResolvedObjectAdapter, self).__getattribute__
-            return _super(name)
-
-    def __getstate__(self):
-        return self._state
-
 class PersistentReference:
 
     __slots__ = "oid",
@@ -191,7 +163,6 @@
         resolved = resolve(old, committed, newstate)
 
         writer = ResolvedObjectWriter()
-        obj = ResolvedObjectAdapter(get_self(resolve), resolved)
-        state = writer.getState(obj)
+        state = writer.getStateFromResolved(get_self(resolve), resolved)
         writer.close()
         return state




More information about the Zope3-Checkins mailing list