# # # patch "src/monotone/MonotoneManager.cpp" # from [1174b802e8c4bda9422032ee5abd6b2b97626e66] # to [fbe8d959362583c08be692314ab320dbb83b9c1e] # ============================================================ --- src/monotone/MonotoneManager.cpp 1174b802e8c4bda9422032ee5abd6b2b97626e66 +++ src/monotone/MonotoneManager.cpp fbe8d959362583c08be692314ab320dbb83b9c1e @@ -376,6 +376,16 @@ QString MonotoneManager::getInterfaceVer -1 if right is greater 0 if both are equal 1 if left is greater + + If a string addition ("flag") is supplied to a particular argument, + a version without such a flag is considered newer than a version with + such a flag, i.e. 0.9dev < 0.9, but 0.9dev > 0.8. + + Of course we can't handle anything fancy like RC (release candidate) + numbering with this, but for now neither monotone nor guitone apply such + a numbering and it could easily be circumvented by separating the RC + numbering with another dot, like 0.9rc.1, 0.9rc.2, aso. + \sa checkInterfaceVersion() */ int MonotoneManager::versionCompare(const QString & left, const QString & right) @@ -387,16 +397,36 @@ int MonotoneManager::versionCompare(cons int rightCount = rightParts.size(); int maxCount = leftCount > rightCount ? leftCount : rightCount; + QRegExp version("(\\d+)(.*)"); + for (int i=0, j=maxCount; i r) return 1; - return -1; + if (l == r && lFlag == rFlag) + continue; + + if (l > r || (l == r && !lFlag && rFlag)) + return 1; + + if (l < r || (l == r && lFlag && !rFlag)) + return -1; + + I(false); } return 0;