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 260291 49abfe1a8ef8
parent 260290 33ea9bfaaeea
child 260292 a0b48af4bb54
push id741
push userryanvm@gmail.com
push date2015-04-27 20:01 +0000
treeherdermozilla-release@d10817faa571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRyanVM, NPOTB
bugs1128586
milestone38.0
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))