From e00534635edbf87535bee06be9adb130c8320bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=BCppers?= Date: Fri, 19 Dec 2014 19:24:13 +0100 Subject: [PATCH 1/6] Update boot.js --- boot/boot.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index fe34f2734..3f653ca79 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -362,21 +362,24 @@ Returns true if the version string A is greater than the version string B. Retur */ $tw.utils.checkVersions = function(versionStringA,versionStringB) { var defaultVersion = { - major: 0, - minor: 0, - patch: 0 - }, - versionA = $tw.utils.parseVersion(versionStringA) || defaultVersion, - versionB = $tw.utils.parseVersion(versionStringB) || defaultVersion, - diff = [ - versionA.major - versionB.major, - versionA.minor - versionB.minor, - versionA.patch - versionB.patch - ]; + major: 0, + minor: 0, + patch: 0, + build: 0 + }, + versionA = $tw.utils.parseVersion(versionStringA) || defaultVersion, + versionB = $tw.utils.parseVersion(versionStringB) || defaultVersion, + diff = [ + versionA.major - versionB.major, + versionA.minor - versionB.minor, + versionA.patch - versionB.patch, + versionA.build - versionB.build + ]; return (diff[0] > 0) || (diff[0] === 0 && diff[1] > 0) || (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] === 0); + (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && diff[3] > 0) || + (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && diff[3] === 0); }; /* @@ -1966,4 +1969,4 @@ if(typeof(exports) !== "undefined") { exports.TiddlyWiki = _boot; } else { _boot(window.$tw); -} \ No newline at end of file +} From 9fad60beb391775caa3c0df547f7a43d5188608d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=BCppers?= Date: Sun, 21 Dec 2014 20:55:44 +0100 Subject: [PATCH 3/6] another suggestion in case of equal versions, use the incoming and replace the existing. --- boot/boot.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 3f653ca79..9687d5fb4 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -364,22 +364,18 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) { var defaultVersion = { major: 0, minor: 0, - patch: 0, - build: 0 + patch: 0 }, versionA = $tw.utils.parseVersion(versionStringA) || defaultVersion, versionB = $tw.utils.parseVersion(versionStringB) || defaultVersion, diff = [ versionA.major - versionB.major, versionA.minor - versionB.minor, - versionA.patch - versionB.patch, - versionA.build - versionB.build + versionA.patch - versionB.patch ]; return (diff[0] > 0) || (diff[0] === 0 && diff[1] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && diff[3] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && diff[3] === 0); + (diff[0] === 0 && diff[1] === 0 && diff[2] > 0); }; /* From 1d344dba69e2aa1ed60801058b1b4cc1273908f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=BCppers?= Date: Tue, 23 Dec 2014 13:53:58 +0100 Subject: [PATCH 4/6] prerelease matters incoming 3.7.2 loses against existing 3.7.2 incoming 3.7.2-prerelease loses against existing 3.7.2 incoming 3.7.2-prerelease wins against existing 3.7.2-prerelease --- boot/boot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 9687d5fb4..587a7af38 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -375,7 +375,8 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) { ]; return (diff[0] > 0) || (diff[0] === 0 && diff[1] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] > 0); + (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) || + ((diff[0] === 0 && diff[1] === 0 && diff[2] === 0) && !(versionA.prerelease && versionB.prerelease)); }; /* From d33b5250677632d826f9c15a8dd554511bee5a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=BCppers?= Date: Tue, 23 Dec 2014 18:13:59 +0100 Subject: [PATCH 5/6] Update boot.js --- boot/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 587a7af38..2daf477b4 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -376,7 +376,7 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) { return (diff[0] > 0) || (diff[0] === 0 && diff[1] > 0) || (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) || - ((diff[0] === 0 && diff[1] === 0 && diff[2] === 0) && !(versionA.prerelease && versionB.prerelease)); + (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && !versionB.prerelease); }; /* From 70cbb5efc5bad77e4959214ebb0e53c669e774d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20K=C3=BCppers?= Date: Tue, 23 Dec 2014 19:21:54 +0100 Subject: [PATCH 6/6] Update boot.js if major, minor and patch are equal, the incoming wins. --- boot/boot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 2daf477b4..9687d5fb4 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -375,8 +375,7 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) { ]; return (diff[0] > 0) || (diff[0] === 0 && diff[1] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] > 0) || - (diff[0] === 0 && diff[1] === 0 && diff[2] === 0 && !versionB.prerelease); + (diff[0] === 0 && diff[1] === 0 && diff[2] > 0); }; /*