[Checkins] SVN: Products.GenericSetup/branches/1.4/Products/GenericSetup/ merge r85288 from trunk

Wichert Akkerman wichert at wiggy.net
Mon Nov 3 10:57:20 EST 2008


Log message for revision 92759:
  merge r85288 from trunk

Changed:
  U   Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt
  U   Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py

-=-
Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt	2008-11-03 15:56:20 UTC (rev 92758)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt	2008-11-03 15:57:19 UTC (rev 92759)
@@ -7,6 +7,9 @@
 - Avoid even an explicit purge of the rolemap if no XML file is present
   in a given context.  (https://bugs.launchpad.net/zope-cmf/+bug/279294)
 
+- Changed upgrade logic to set the current version after an upgrade to the
+  of the last step, instead of the current profile version.
+
 GenericSetup 1.4.2.2 (2008-09-22)
 ---------------------------------
 

Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py	2008-11-03 15:56:20 UTC (rev 92758)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py	2008-11-03 15:57:19 UTC (rev 92759)
@@ -958,6 +958,7 @@
         logger = logging.getLogger('GenericSetup')
         steps_to_run = request.form.get('upgrades', [])
         profile_id = request.get('profile_id', '')
+        step = None
         for step_id in steps_to_run:
             step = _upgrade_registry.getUpgradeStep(profile_id, step_id)
             if step is not None:
@@ -966,12 +967,9 @@
                                                               profile_id)
                 logger.log(logging.INFO, msg)
 
-        # XXX should be a bit smarter about deciding when to up the
-        #     profile version
-        profile_info = _profile_registry.getProfileInfo(profile_id)
-        version = profile_info.get('version', None)
-        if version is not None:
-            self.setLastVersionForProfile(profile_id, version)
+        # We update the profile version to the last one we have reached
+        # with runnning an upgrade step.
+        self.setLastVersionForProfile(profile_id, step.dest)
 
         url = self.absolute_url()
         request.RESPONSE.redirect("%s/manage_upgrades?saved=%s" % (url, profile_id))



More information about the Checkins mailing list