]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix "HGPLAIN" environmental variable in Windows
authorepriestley <git@epriestley.com>
Wed, 2 May 2012 19:40:02 +0000 (12:40 -0700)
committerepriestley <git@epriestley.com>
Wed, 2 May 2012 19:40:02 +0000 (12:40 -0700)
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

index 57c256f2e8ec1f0691b015c47758e53d1c6410b3..98f5176acf9e53750a97fc042428e53de917c1d9 100644 (file)
@@ -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());