From: epriestley Date: Tue, 29 Jan 2013 00:28:14 +0000 (-0800) Subject: Correct a bunch of mercurial revset construction X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=410b58a2e23560319dd9625a3868945375d1b62a;p=arcanist.git Correct a bunch of mercurial revset construction 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 --- diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 5e791920..da5d1bb7 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -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);