From 8465c4dd53cb352eb55a21c0fd9dbb385f8d5b56 Mon Sep 17 00:00:00 2001 From: durham Date: Wed, 14 Aug 2013 18:00:51 -0700 Subject: [PATCH] Fix arc land for mercurial on windows Summary: arc for mercurial on windows was broken in several way. Executing a command via passthru failed because passthru on windows skips the shell so 'set HGPLAIN=1 & ...' was an invalid command. The fix was to just not set HGPLAIN for passthru commands on windows. Also removed hardcoded '' quotes in mercurial commands since windows doesn't support single quots. Test Plan: arc land --hold on a windows machine Reviewers: epriestley Reviewed By: epriestley CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D6763 --- src/repository/api/ArcanistMercurialAPI.php | 2 +- src/workflow/ArcanistLandWorkflow.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php index c6e6796f..0029c318 100644 --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -40,7 +40,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { public function execPassthru($pattern /* , ... */) { $args = func_get_args(); if (phutil_is_windows()) { - $args[0] = 'set HGPLAIN=1 & hg '.$args[0]; + $args[0] = 'hg '.$args[0]; } else { $args[0] = 'HGPLAIN=1 hg '.$args[0]; } diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 65f798e2..374bd82f 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -565,7 +565,7 @@ EOTEXT // Pull succeeded. Now make sure master is not on an outgoing change if ($repository_api->supportsPhases()) { list($out) = $repository_api->execxLocal( - 'log -r %s --template {phase}', $this->onto); + 'log -r %s --template %s', $this->onto, "{phase}"); if ($out != 'public') { $local_ahead_of_remote = true; } @@ -731,8 +731,9 @@ EOTEXT // check if the branch had children list($output) = $repository_api->execxLocal( - "log -r %s --template '{node}\\n'", - hgsprintf("children(%s)", $this->branch)); + "log -r %s --template %s", + hgsprintf("children(%s)", $this->branch), + '{node}\n'); $child_branch_roots = phutil_split_lines($output, false); $child_branch_roots = array_filter($child_branch_roots); @@ -786,7 +787,8 @@ EOTEXT $this->branch, $branch_range); list($alt_branches) = $repository_api->execxLocal( - "log --template '{node}\n' -r %s", + "log --template %s -r %s", + '{node}\n', $alt_branch_revset); $alt_branches = phutil_split_lines($alt_branches, false); -- 2.43.0