From dc84dbbbf708920a0b42b5c0b6699c964d8286df Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 1 Apr 2021 10:09:49 +0200 Subject: [PATCH] Fixed detection of hg version when localized, fixes #9753 --- CHANGELOG.md | 3 ++- src/Composer/Util/Hg.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a473d38..9b7fc7b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,14 @@ ### [2.0.12] 2021-04-01 * Fixed support for new GitHub OAuth token format (#9757) - * Fixed support for Vagrant/VirtualBox filesystem slowness by adding short sleeps in some places (#9627) + * Fixed support for Vagrant/VirtualBox filesystem slowness by adding short sleeps in some places (#9627) * Fixed unclear error reporting when a package is in the lock file but not in the remote repositories (#9750) * Fixed processes silently ignoring the CWD when it does not exist * Fixed new Windows bin handling to avoid proxying phar files (#9742) * Fixed issue extracting archives into paths that already exist, fixing problems with some custom installers (composer/installers#479) * Fixed support for branch names starting with master/trunk/default (#9739) * Fixed self-update to preserve phar file permissions on Windows (#9733) + * Fixed detection of hg version when localized (#9753) * Fixed git execution failures to also include the stdout output (#9720) ### [2.0.11] 2021-02-24 diff --git a/src/Composer/Util/Hg.php b/src/Composer/Util/Hg.php index a0ebac01d..fe0649dbb 100644 --- a/src/Composer/Util/Hg.php +++ b/src/Composer/Util/Hg.php @@ -92,7 +92,7 @@ class Hg { if (false === self::$version) { self::$version = null; - if (0 === $process->execute('hg --version', $output) && preg_match('/version (\d+(?:\.\d+)+)/m', $output, $matches)) { + if (0 === $process->execute('hg --version', $output) && preg_match('/^.+? (\d+(?:\.\d+)+)\)?\r?\n/', $output, $matches)) { self::$version = $matches[1]; } }