1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

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
This commit is contained in:
durham 2013-08-14 18:00:51 -07:00
parent acb90fd9e7
commit 8465c4dd53
2 changed files with 7 additions and 5 deletions

View file

@ -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];
}

View file

@ -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);