[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/ Added logic to respect the destination of upgrade steps when determining their applicability.

Hanno Schlichting plone at hannosch.info
Mon Apr 14 04:27:58 EDT 2008


Log message for revision 85354:
  Added logic to respect the destination of upgrade steps when determining their applicability.
  

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
  U   Products.GenericSetup/trunk/Products/GenericSetup/upgrade.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2008-04-14 01:53:37 UTC (rev 85353)
+++ Products.GenericSetup/trunk/Products/GenericSetup/CHANGES.txt	2008-04-14 08:27:34 UTC (rev 85354)
@@ -2,6 +2,9 @@
 
   GenericSetup 1.5.0 (unreleased)
 
+    - Added logic to respect the destination of upgrade steps when determining
+      their applicability. 
+
     - Enhanced the readability of the upgrades tab on the tool.
 
     - Changed upgrade logic to set the current version after an upgrade to the

Modified: Products.GenericSetup/trunk/Products/GenericSetup/upgrade.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/upgrade.py	2008-04-14 01:53:37 UTC (rev 85353)
+++ Products.GenericSetup/trunk/Products/GenericSetup/upgrade.py	2008-04-14 08:27:34 UTC (rev 85354)
@@ -102,8 +102,16 @@
         self.profile = profile
 
     def versionMatch(self, source):
-        return (source is None or self.source is None or
-                normalize_version(source) <= normalize_version(self.source))
+        source = normalize_version(source)
+        return (
+            source is None or
+            (self.source is None and
+                (self.dest is None or source < normalize_version(self.dest))
+            ) or
+            (source <= normalize_version(self.source) and
+                (self.dest is None or source > normalize_version(self.dest))
+            )
+        )
 
     def isProposed(self, tool, source):
         """Check if a step can be applied.



More information about the Checkins mailing list