]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Correct a bunch of mercurial revset construction
authorepriestley <git@epriestley.com>
Tue, 29 Jan 2013 00:28:14 +0000 (16:28 -0800)
committerepriestley <git@epriestley.com>
Tue, 29 Jan 2013 00:28:14 +0000 (16:28 -0800)
Summary: Possibly improves T2387 state of the world?

Test Plan: not yet

Reviewers: bos, DurhamGoode

Reviewed By: DurhamGoode

CC: aran
Maniphest Tasks: T2387

Differential Revision: https://secure.phabricator.com/D4712

src/workflow/ArcanistLandWorkflow.php

index 5e7919208f0c2dd9d5f145b454be00b4faea6ab9..da5d1bb71b8afe76923cc438b548d4b430f49481 100644 (file)
@@ -478,7 +478,7 @@ EOTEXT
     } else if ($this->isHg) {
       $onto_tip = $repository_api->getCanonicalRevisionName($this->onto);
       $common_ancestor = $repository_api->getCanonicalRevisionName(
-        sprintf("ancestor('%s','%s')",
+        hgsprintf("ancestor(%s, %s)",
           $this->onto,
           $this->branch));
 
@@ -531,12 +531,12 @@ EOTEXT
       // function). So we're guaranteed to have onto as an ancestor of branch
       // when we use first((onto::branch)-onto) below.
       $branch_root = $repository_api->getCanonicalRevisionName(
-        sprintf("first((%s::%s)-%s)",
+        hgsprintf("first((%s::%s)-%s)",
           $this->onto,
           $this->branch,
           $this->onto));
 
-      $branch_range = sprintf(
+      $branch_range = hgsprintf(
         "(%s::%s)",
         $branch_root,
         $this->branch);
@@ -571,7 +571,7 @@ EOTEXT
       // check if the branch had children
       list($output) = $repository_api->execxLocal(
         "log -r %s --template '{node}\\n'",
-        sprintf("children(%s)", $this->branch));
+        hgsprintf("children(%s)", $this->branch));
 
       $child_branch_roots = phutil_split_lines($output, false);
       $child_branch_roots = array_filter($child_branch_roots);
@@ -632,8 +632,8 @@ EOTEXT
     // 2. roots({x,g,y,z} - {g} - {w,x})
     // 3. roots({y,z})
     // 4. {y,z}
-    $alt_branch_revset = sprintf(
-      'roots(descendants(%s)-descendants(%s)-%s)',
+    $alt_branch_revset = hgsprintf(
+      'roots(descendants(%s)-descendants(%s)-%R)',
       $branch_root,
       $this->branch,
       $branch_range);