Sun, 25 Jul 2021 12:26:07 +0200
Updated the install script to use a environment specific mercurial if that is available.
scripts/install.py | file | annotate | diff | comparison | revisions |
--- a/scripts/install.py Sun Jul 18 14:28:27 2021 +0200 +++ b/scripts/install.py Sun Jul 25 12:26:07 2021 +0200 @@ -1758,10 +1758,17 @@ with contextlib.suppress(OSError): os.rename(fileName, fileName + ".orig") - try: - hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok - hgOut = hgOut.decode() - except (OSError, subprocess.CalledProcessError): + if sys.platform.startswith(("win", "cygwin")): + localHg = os.path.join(sys.exec_prefix, "Scripts", "hg.exe") + else: + localHg = os.path.join(sys.exec_prefix, "bin", "hg") + for hg in (localHg, "hg"): + with contextlib.suppress(OSError, subprocess.CalledProcessError): + hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok + hgOut = hgOut.decode() + if hgOut: + break + else: hgOut = "" if hgOut: hgOut = hgOut.strip()