[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.5
Guido van Rossum
guido@python.org
Tue, 6 May 2003 18:04:06 -0400
Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv19149
Modified Files:
syncer.py
Log Message:
There was a problem with _p_serial being wiped out. As a temporary
hack, save+restore it. XXX But really, Persistent.__setstate__ should
preserve _p_serial.
=== Zope3/src/zope/app/fssync/syncer.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.4 Tue May 6 15:58:44 2003
+++ Zope3/src/zope/app/fssync/syncer.py Tue May 6 18:04:06 2003
@@ -38,6 +38,8 @@
name -- The name of the object
location -- The directory on the file system where the object will go
+
+ XXX what are mode and objpath?
"""
objectPath = ''
# Look for location admin dir
@@ -231,7 +233,14 @@
# Nope, we have to replace.
_setItem(container, name, newOb, old=1)
else:
+ # XXX Hack: __setstate__ wipes out _p_serial,
+ # so for now we must save+restore it.
+ # But really, Persistent.__setstate__ should
+ # preserve _p_serial.
+ oldserial = getattr(oldOb, "_p_serial", None)
oldOb.__setstate__(getstate())
+ if oldserial is not None:
+ oldOb._p_serial = oldserial
oldOb._p_changed = 1