From 52e08cc6c59155c5b012350c1d465bbc93bebfe9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 2 May 2012 12:40:02 -0700 Subject: [PATCH] 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 --- src/repository/api/mercurial/ArcanistMercurialAPI.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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());