[Bf-blender-cvs] [8a5da947dc6] master: Fix error in 'preferences.copy_prev' checking for the last version

Campbell Barton noreply at git.blender.org
Thu Jul 23 10:44:16 CEST 2020


Commit: 8a5da947dc66beb8d11acc6222fd6ec38d0d5bd7
Author: Campbell Barton
Date:   Thu Jul 23 18:31:31 2020 +1000
Branches: master
https://developer.blender.org/rB8a5da947dc66beb8d11acc6222fd6ec38d0d5bd7

Fix error in 'preferences.copy_prev' checking for the last version

The check to avoid updating between major releases prevented
2.90 files being copied to 2.91

===================================================================

M	release/scripts/startup/bl_operators/userpref.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 2e14df1920f..e92f493960a 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -119,8 +119,11 @@ class PREFERENCES_OT_copy_prev(Operator):
         # Find config folder from previous version.
         import os
         version = bpy.app.version
+        version_new = ((version[0] * 100) + version[1])
         version_old = ((version[0] * 100) + version[1]) - 1
-        while version_old % 10 > 0:
+        # Ensure we only try to copy files from a point release.
+        # The check below ensures the second numbers match.
+        while (version_new % 100) // 10 == (version_old % 100) // 10:
             version_split = version_old // 100, version_old % 100
             if os.path.isdir(cls._old_version_path(version_split)):
                 return version_split



More information about the Bf-blender-cvs mailing list