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

Fred L. Drake, Jr. fred@zope.com
Tue, 8 Jul 2003 13:33:43 -0400


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

Modified Files:
	fsmerger.py 
Log Message:
- when a file has been added on one side and a directory on the other,
  sharing the same name, don't try to merge the extras and annotations
  after reporting the error (actually a special kind of conflict)
- add some comments
- reportaction() ensures 'letter' is always set, so don't check for it


=== Zope3/src/zope/fssync/fsmerger.py 1.12 => 1.13 ===
--- Zope3/src/zope/fssync/fsmerger.py:1.12	Tue Jun 10 15:12:26 2003
+++ Zope3/src/zope/fssync/fsmerger.py	Tue Jul  8 13:33:39 2003
@@ -54,6 +54,9 @@
             # One is a file, the other is a directory
             # XXX We should be able to deal with this case, too
             self.reporter("XXX %s" % local)
+            # XXX probably for the best; we *don't* know the right
+            # thing to do anyway
+            return
         self.merge_extra(local, remote)
         self.merge_annotations(local, remote)
         if not exists(local) and not self.metadata.getentry(local):
@@ -124,6 +127,7 @@
                         lentry.update(rentry)
                         self.reportdir("N", localdir)
                     else:
+                        # call make_dir() to create @@Zope and store metadata
                         self.make_dir(localdir)
                         self.reportdir("*", localdir)
                 return
@@ -161,6 +165,9 @@
                 else:
                     # Tree removed remotely, must recurse down locally
                     for name in lentrynames:
+                        # merge() removes the local copies since the
+                        # remote versions are gone, unless there have
+                        # been local changes.
                         self.merge(join(localdir, name), join(remotedir, name))
                     self.clear_dir(localdir)
                     return
@@ -173,6 +180,7 @@
                 self.reportdir("R", localdir)
                 return # There's no point in recursing down!
             if rentry or rentrynames:
+                # remote directory is new
                 self.make_dir(localdir)
                 lentry.update(rentry)
                 self.reportdir("N", localdir)
@@ -285,8 +293,7 @@
         elif state == "Nonexistent":
             if action == "Delete":
                 letter = "D"
-        if letter:
-            self.reporter("%s %s" % (letter, local))
+        self.reporter("%s %s" % (letter, local))
 
     def ignore(self, path):
         # XXX This should have a larger set of default patterns to