[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - committer.py:1.18

Fred L. Drake, Jr. fred at zope.com
Fri Sep 5 15:41:16 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv13028

Modified Files:
	committer.py 
Log Message:
If there isn't an "original" data file, the file should be handled as
if it were being added.  This makes it easier to support object
copying from an fssync checkout.


=== Zope3/src/zope/app/fssync/committer.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/fssync/committer.py:1.17	Sun Aug 17 02:06:34 2003
+++ Zope3/src/zope/app/fssync/committer.py	Fri Sep  5 14:41:16 2003
@@ -304,7 +304,17 @@
             if adapter.typeIdentifier() != entry.get("type"):
                 create_object(container, name, entry, fspath, replace=True)
             else:
-                olddata = read_file(fsutil.getoriginal(fspath))
+                original_fn = fsutil.getoriginal(fspath)
+                if os.path.exists(original_fn):
+                    olddata = read_file(original_fn)
+                else:
+                    # value appears to exist in the object tree, but
+                    # may have been created as a side effect of an
+                    # addition in the parent; this can easily happen
+                    # in the extra or annotation data for an object
+                    # copied from another using "zsync copy" (for
+                    # example)
+                    olddata = None
                 newdata = read_file(fspath)
                 if newdata != olddata:
                     if not entry.get("factory"):




More information about the Zope3-Checkins mailing list