Closed Bug 935741 Opened 9 years ago Closed 9 years ago
Bootstrap: Mercurial version detection broken when Mercurial is in italian language
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release) Build ID: 20131024054843 Steps to reproduce: Ubuntu 13.10 - italian language Mercurial installed with italian locale (hg --version outputs: Mercurial SCM Distribuito (versione 2.7.2) ) python python/mozboot/bin/bootstrap.py Actual results: Display: ERROR: Unable to identify Mercurial version. We attempted to upgrade Mercurial to a modern version (2.5 or newer). However, you appear to have version None still. It's possible your package manager doesn't support a modern version of Mercurial. It's also possible Mercurial is not being installed in the search path for this shell. Try creating a new shell and run this bootstrapper again. If it continues to fail, consider installing Mercurial by following the instructions at http://mercurial.selenic.com/. Expected results: Display: Your version of Mercurial (2.7.2) is sufficiently modern.
Assignee: nobody → desantis.maurizio
Status: UNCONFIRMED → ASSIGNED
Component: Untriaged → Build Config
Ever confirmed: true
Product: Firefox → Core
Comment on attachment 828290 [details] [diff] [review] Fix Review of attachment 828290 [details] [diff] [review]: ----------------------------------------------------------------- One-offing Italian is not a sufficient fix. What about German, Russian, French, ... If we're going to do this, we should do it right. I'm not sure how Mercurial does it's localization, but we should attempt to set an environment variable to force English or something. Alternatively, we could change the version detection string to look for \d+\.\d+\.\d+ or something.
Attachment #828290 - Flags: review-
(In reply to Gregory Szorc [:gps] from comment #2) > One-offing Italian is not a sufficient fix. What about German, Russian, > French, ... I agree, sorry for the poor quality of my patch, I did it without thinking about implications > I'm not sure how Mercurial does it's localization, but we should attempt > to set an environment variable to force English or something. I tried to use LANG=C hg --version and I still have "versione" instead of "version" > Alternatively, we could change the version > detection string to look for \d+\.\d+\.\d+ or something. Probably this is the best way, maybe restricting the regex scan to the first line of the output, in order to avoid false positives in an hypotetic future change of the hg --version output
I did some source code diving. `HGPLAIN=1 hg --version` should work (at least with sufficiently modern versions of Mercurial). The docs say "the output should be stable, reproducible and suitable for use in scripts or applications." This sounds like exactly what we want!
It works! HGPLAIN=1 hg --version outputs: Mercurial Distributed SCM (version 2.7.2) I'll upload a new patch
Fix using HGPLAIN
Attachment #828290 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.