comparison static/js/download.js @ 360:8e3b10220bb9

Mercurial version x.y.z, z=0 is always incorrect; disregard. An erroneous latest.dat should be fixed, but this patch will prevent such errors from having a negative effect on the website. (They cause prior versions not to be displayed even when they should be, if Downloader.maxversions is nonzero.) geocommit(1.0): lat 49.0076053, long 8.4207923, hacc 82.0, src nmg; Karlsruhe DE
author David Champion <dgc@uchicago.edu>
date Wed, 02 Mar 2011 11:47:34 -0600
parents a71e03f5edde
children c65b81353b8f
comparison
equal deleted inserted replaced
359:99a81d6b669a 360:8e3b10220bb9
1 function Download (source) { 1 function Download (source) {
2 this.version = source[0]; 2 this.version = source[0];
3 this.regex = source[1]; 3 this.regex = source[1];
4 this.url = source[2]; 4 this.url = source[2];
5 this.desc = source[3]; 5 this.desc = source[3];
6
7 // Strip '.0' version suffix, unless it is for a minor version.
8 // It is always incorrect for Mercurial releases.
9 var points = this.version.split('.');
10 if (points.length > 2 && points[points.length-1] == "0") {
11 points.pop();
12 this.version = points.join(".");
13 }
6 } 14 }
7 15
8 Download.prototype = { 16 Download.prototype = {
9 matches: function (ua) { 17 matches: function (ua) {
10 if (ua.match(this.regex)) 18 if (ua.match(this.regex))