[Checkins] SVN: z3c.vcsync/trunk/ Fix off-by-one error during svn up.

Martijn Faassen faassen at infrae.com
Tue Feb 26 12:22:42 EST 2008


Log message for revision 84274:
  Fix off-by-one error during svn up.
  

Changed:
  U   z3c.vcsync/trunk/CHANGES.txt
  U   z3c.vcsync/trunk/src/z3c/vcsync/svn.py

-=-
Modified: z3c.vcsync/trunk/CHANGES.txt
===================================================================
--- z3c.vcsync/trunk/CHANGES.txt	2008-02-26 15:47:33 UTC (rev 84273)
+++ z3c.vcsync/trunk/CHANGES.txt	2008-02-26 17:22:41 UTC (rev 84274)
@@ -11,6 +11,13 @@
   file might have been removed in SVN and there is no more need to
   re-remove it if it was also removed locally.
 
+* There was an off-by one error during the "up" phase of
+  synchronization with SVN, and as a result a log entry that was
+  already processed could be re-processed during this next
+  synchronisation. This could in some cases revive folders as unknown
+  directories on the filesystem, leading to errors and
+  inconsistencies.
+
 0.10 (2008-01-08)
 -----------------
 

Modified: z3c.vcsync/trunk/src/z3c/vcsync/svn.py
===================================================================
--- z3c.vcsync/trunk/src/z3c/vcsync/svn.py	2008-02-26 15:47:33 UTC (rev 84273)
+++ z3c.vcsync/trunk/src/z3c/vcsync/svn.py	2008-02-26 17:22:41 UTC (rev 84274)
@@ -59,9 +59,11 @@
         new_revision_nr = int(self.path.status().rev)
         if self._updated_revision_nr == new_revision_nr:
             return
-        # logs won't include revision_nr itself, but that's what we want
         if new_revision_nr > revision_nr:
-            logs = self.path.log(revision_nr, new_revision_nr, verbose=True)
+            # we don't want logs to include the entry for revision_nr itself
+            # so we add + 1 to it
+            logs = self.path.log(revision_nr + 1, new_revision_nr,
+                                 verbose=True)
         else:
             # the log function always seem to return at least one log
             # entry (the latest one). This way we skip that check if not



More information about the Checkins mailing list