[Checkins] SVN: z3c.vcsync/trunk/src/z3c/vcsync/vc.py A few fixes.

Martijn Faassen faassen at infrae.com
Thu Jul 5 16:02:32 EDT 2007


Log message for revision 77481:
  A few fixes.
  

Changed:
  U   z3c.vcsync/trunk/src/z3c/vcsync/vc.py

-=-
Modified: z3c.vcsync/trunk/src/z3c/vcsync/vc.py
===================================================================
--- z3c.vcsync/trunk/src/z3c/vcsync/vc.py	2007-07-05 20:02:25 UTC (rev 77480)
+++ z3c.vcsync/trunk/src/z3c/vcsync/vc.py	2007-07-05 20:02:32 UTC (rev 77481)
@@ -94,8 +94,9 @@
                 # find the file and remove it
                 file_paths = list(container_dir_path.listdir(
                     str('%s.*' % name)))
-                assert len(file_paths) == 1
-                file_paths[0].remove()
+                # (could be 0 files in some cases)
+                for file_path in file_paths:
+                    file_path.remove()
 
         # now save all files that have been modified/added
         root = self.state.root
@@ -119,6 +120,10 @@
         # to ensure that containers are created before items we sort them
         file_paths.sort()
         for file_path in file_paths:
+            # we might get something that doesn't actually exist anymore
+            # as it was since removed, so skip it
+            if not file_path.check():
+                continue
             container = resolve_container(root, self.checkout.path, file_path)
             factory = getUtility(IVcFactory, name=file_path.ext)
             name = file_path.purebasename



More information about the Checkins mailing list