summaryrefslogtreecommitdiff
path: root/src/mongo/util/version.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-02-23 12:11:22 -0500
committerMathias Stearn <mathias@10gen.com>2015-02-24 11:13:15 -0500
commit5bfcf828bf5de6d01fa7f8775b1b88c4924db1ef (patch)
tree0850c3a116bbde9fb33adc93f1a1fcbfaca76faf /src/mongo/util/version.cpp
parent4a8b10a7bb9154c19b8a60cbda7b2f5d8f6b3d44 (diff)
downloadmongo-5bfcf828bf5de6d01fa7f8775b1b88c4924db1ef.tar.gz
SERVER-17352 Allow RCs up to 49
Diffstat (limited to 'src/mongo/util/version.cpp')
-rw-r--r--src/mongo/util/version.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp
index 513ba9e6e57..443eda243c9 100644
--- a/src/mongo/util/version.cpp
+++ b/src/mongo/util/version.cpp
@@ -43,7 +43,7 @@ namespace mongo {
/* Approved formats for versionString:
* 1.2.3
* 1.2.3-pre-
- * 1.2.3-rc4 (up to rc9)
+ * 1.2.3-rc4 (rc0 up to rc49)
* 1.2.3-rc4-pre-
* If you really need to do something else you'll need to fix _versionArray()
*/
@@ -55,7 +55,7 @@ namespace mongo {
BSONArrayBuilder b;
string curPart;
const char* c = version;
- int finalPart = 0; // 0 = final release, -100 = pre, -10 to -1 = -10 + X for rcX
+ int finalPart = 0; // 0 = final release, -100 = pre, -50 to -1 = -50 + X for rcX
do { //walks versionString including NUL byte
if (!(*c == '.' || *c == '-' || *c == '\0')){
curPart += *c;
@@ -71,9 +71,11 @@ namespace mongo {
break;
}
else if (str::startsWith(curPart, "rc")){
- num = 0;
- verify( parseNumberFromString( curPart.substr(2), &num ).isOK() );
- finalPart = -10 + num;
+ int rc;
+ invariantOK(parseNumberFromString( curPart.substr(2), &rc ));
+ invariant(rc >= 0);
+ invariant(rc < 50); // Need to adjust calculation if we pass this.
+ finalPart = -50 + rc;
break;
}
else if (curPart == "pre"){