[PATCH hg-website] Terminal ".0" is always incorrect for Mercurial versions; disregard

David Champion dgc at uchicago.edu
Wed Mar 2 17:51:23 UTC 2011


The latest.dat should be fixed, but this will prevent similar errors
in the future from having a negative effect on the website.  (It
causes 1.7.5 versions not to be displayed, because the value of
Downloader.maxversions is only 2.)

# HG changeset patch
# User David Champion <dgc at uchicago.edu>
# Date 1299088054 21600
# Node ID 335a2cc4a8160cf7491efc090a91c0d74769506c
# Parent  946b08cf525c337940aafe81e6297aa1186bbd90
Terminal ".0" is always incorrect for Mercurial versions; disregard.

diff --git a/static/js/download.js b/static/js/download.js
--- a/static/js/download.js
+++ b/static/js/download.js
@@ -3,6 +3,10 @@
     this.regex = source[1];
     this.url = source[2];
     this.desc = source[3];
+
+    // Strip '.0' version suffix. It is always incorrect for Mercurial releases.
+    if (this.version.indexOf('.0', this.version.length - 2) != -1)
+        this.version = this.version.substr(0, this.version.length - 2);
 }
 
 Download.prototype = {





More information about the Mercurial-packaging mailing list