From: epriestley Date: Wed, 2 May 2012 19:40:02 +0000 (-0700) Subject: Fix "HGPLAIN" environmental variable in Windows X-Git-Tag: conduit-4~28 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=52e08cc6c59155c5b012350c1d465bbc93bebfe9;p=arcanist.git Fix "HGPLAIN" environmental variable in Windows Summary: In Windows, you can't use `X=y cmd` syntax to set variables. Use "set X=y & cmd" instead. Test Plan: - Ran "arc diff" in a Mercurial repo in Windows, created D2367. - Verified this does //not// cause 'HGPLAIN' to be set in the outer shell (where you type "arc diff"). Reviewers: Makinde, tido, indiefan, btrahan Reviewed By: tido CC: aran Maniphest Tasks: T1179 Differential Revision: https://secure.phabricator.com/D2368 --- diff --git a/src/repository/api/mercurial/ArcanistMercurialAPI.php b/src/repository/api/mercurial/ArcanistMercurialAPI.php index 57c256f2..98f5176a 100644 --- a/src/repository/api/mercurial/ArcanistMercurialAPI.php +++ b/src/repository/api/mercurial/ArcanistMercurialAPI.php @@ -42,7 +42,11 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { // There is an HGPLAIN environmental variable which enables "plain mode" // and hopefully disables this stuff. - $argv[0] = 'HGPLAIN=1 hg '.$argv[0]; + if (phutil_is_windows()) { + $argv[0] = 'set HGPLAIN=1 & hg '.$argv[0]; + } else { + $argv[0] = 'HGPLAIN=1 hg '.$argv[0]; + } $future = newv('ExecFuture', $argv); $future->setCWD($this->getPath());