]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix arc land for mercurial on windows
authordurham <durham@fb.com>
Thu, 15 Aug 2013 01:00:51 +0000 (18:00 -0700)
committerdurham <durham@fb.com>
Thu, 15 Aug 2013 01:00:51 +0000 (18:00 -0700)
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
src/workflow/ArcanistLandWorkflow.php

index c6e6796f9f7f0f247278a5ea8a869995781a261f..0029c3180d0a42b26f5cbd3b4a537ff5233ef616 100644 (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];
     }
index 65f798e2676da0ff0c42e69a258f403d027b04e8..374bd82f0a469bd8a1bbc1493c6f60e3f7f84333 100644 (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);