Mercurial > hg-website
changeset 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 | 99a81d6b669a |
children | d067289f1121 |
files | static/js/download.js |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/static/js/download.js Thu Mar 03 14:11:58 2011 +0100 +++ b/static/js/download.js Wed Mar 02 11:47:34 2011 -0600 @@ -3,6 +3,14 @@ this.regex = source[1]; this.url = source[2]; this.desc = source[3]; + + // Strip '.0' version suffix, unless it is for a minor version. + // It is always incorrect for Mercurial releases. + var points = this.version.split('.'); + if (points.length > 2 && points[points.length-1] == "0") { + points.pop(); + this.version = points.join("."); + } } Download.prototype = {