[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.11

Guido van Rossum guido@python.org
Sat, 10 May 2003 20:16:36 -0400


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

Modified Files:
	syncer.py 
Log Message:
Add a primitive 'add' facility to fssync.

=== Zope3/src/zope/app/fssync/syncer.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.10	Sat May 10 18:00:53 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Sat May 10 20:16:05 2003
@@ -256,10 +256,11 @@
     extra_entries_path = os.path.join(extra_dir, "@@Zope", "Entries.xml")
     if extra:
         if not os.path.exists(extra_entries_path):
-            # The file system has no extras, so delete all of the object's
-            # extras.
-            for key in extra:
-                del extra[key]
+            if entry.get("flag") != "added":
+                # The file system has no extras, so delete all of the
+                # object's extras.
+                for key in list(extra):
+                    del extra[key]
         else:
             extra_entries = loadFile(extra_entries_path)
             for ename in extra_entries:
@@ -277,10 +278,11 @@
         annotation_dir, "@@Zope", "Entries.xml")
     if annotations is not None:
         if not os.path.exists(annotation_entries_path):
-            # The file system has no annotations, so delete all of the object's
-            # annotations.
-            for key in annotations:
-                del annotations[key]
+            if entry.get("flag") != "added":
+                # The file system has no annotations, so delete all of
+                # the object's annotations.
+                for key in list(annotations):
+                    del annotations[key]
         else:
             annotation_entries = loadFile(annotation_entries_path)
             for ename in annotation_entries: