1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

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
This commit is contained in:
epriestley 2013-12-27 13:16:10 -08:00
parent 9f38aaa5de
commit ce632d6490
2 changed files with 2 additions and 2 deletions

View file

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

View file

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