Bug 1128586 - Properly look for Mercurial version. r=RyanVM, a=NPOTB
authorGregory Szorc <gps@mozilla.com>
Mon, 27 Apr 2015 10:43:25 -0700
changeset 267248 8e80ee81ed024adeefbdf276ca33032c1c9b3dec
parent 267247 48804a318b30271f69f042d030bab2fbbeaed3a3
child 267249 a27d9552ca78cf75c6229666fd65309668c7fb0d
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRyanVM, NPOTB
bugs1128586
milestone39.0a2
Bug 1128586 - Properly look for Mercurial version. r=RyanVM, a=NPOTB `mercurial version` doesn't always print the version number. `mercurial --version` does. Use the latter.
python/mozversioncontrol/mozversioncontrol/__init__.py
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -11,14 +11,14 @@ import subprocess
 from distutils.version import LooseVersion
 
 def get_hg_version(hg):
     """Obtain the version of the Mercurial client."""
 
     env = os.environ.copy()
     env[b'HGPLAIN'] = b'1'
 
-    info = subprocess.check_output([hg, 'version'], env=env)
+    info = subprocess.check_output([hg, '--version'], env=env)
     match = re.search('version ([^\+\)]+)', info)
     if not match:
         raise Exception('Unable to identify Mercurial version.')
 
     return LooseVersion(match.group(1))