[Zope3-checkins] CVS: Zope3/src/zope/fssync - fsmerger.py:1.4

Guido van Rossum guido@python.org
Wed, 28 May 2003 15:08:56 -0400


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

Modified Files:
	fsmerger.py 
Log Message:
Unit testing found another wanting bit.


=== Zope3/src/zope/fssync/fsmerger.py 1.3 => 1.4 ===
--- Zope3/src/zope/fssync/fsmerger.py:1.3	Wed May 28 14:32:45 2003
+++ Zope3/src/zope/fssync/fsmerger.py	Wed May 28 15:08:56 2003
@@ -74,6 +74,7 @@
 
     def merge_dirs(self, localdir, remotedir):
         """Merge remote directory into local directory."""
+        ##import pdb; pdb.set_trace()
         lentrynames = self.metadata.getnames(localdir)
         rentrynames = self.metadata.getnames(remotedir)
         lentry = self.metadata.getentry(localdir)
@@ -120,7 +121,14 @@
                 return
 
         if exists(localdir):
-            self.reportdir("/", localdir)
+            if lentry.get("flag") == "added":
+                if exists(remotedir):
+                    self.reportdir("U", localdir)
+                    del lentry["flag"]
+                else:
+                    self.reportdir("A", localdir)
+            else:
+                self.reportdir("/", localdir)
             lnames = dict([(normcase(name), name)
                            for name in os.listdir(localdir)])
         else: