From ce632d64906b1bd8fc0d0f3c63458edd364e1221 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 27 Dec 2013 13:16:10 -0800 Subject: [PATCH] Use `ancestors(x)` instead of `0::x` in Mercurial history queries Summary: If `0` isn't an ancestor of the current branch, the `0::x` construction fails. This is uncommon, but not wildly unreasonable. The `ancestors()` construction is simpler anyway. Test Plan: Viewed some `hg` repos locally (change history, file history) without anything suspicious cropping up. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7844 --- .../conduit/ConduitAPI_diffusion_historyquery_Method.php | 2 +- .../conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php index 3d552d0725..8cf211509b 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php @@ -125,7 +125,7 @@ extends ConduitAPI_diffusion_abstractquery_Method { '{node};{parents}\\n', ($offset + $limit), // No '--skip' in Mercurial. $branch_arg, - hgsprintf('reverse(%s::%s)', '0', $commit_hash), + hgsprintf('reverse(ancestors(%s))', $commit_hash), $path_arg); $stdout = PhabricatorRepository::filterMercurialDebugOutput($stdout); diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php index 26e679aec3..8cfa1f6f55 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php @@ -87,7 +87,7 @@ final class ConduitAPI_diffusion_lastmodifiedquery_Method list($hash) = $repository->execxLocalCommand( 'log --template %s --limit 1 --removed --rev %s -- %s', '{node}', - hgsprintf('reverse(%s::%s)', '0', $drequest->getCommit()), + hgsprintf('reverse(ancestors(%s))', $drequest->getCommit()), nonempty(ltrim($path, '/'), '.')); return $this->loadDataFromHash($hash);