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

Use reverse(x::y) instead of y::x in Mercurial history queries

The revset "x:0" works, but the revset "x::0" is empty. We actually want "reverse(0::x)".

Auditors: DurhamGoode
This commit is contained in:
epriestley 2013-02-27 20:08:44 -08:00
parent e2c9ebdbc1
commit 88497bf7df
2 changed files with 4 additions and 4 deletions

View file

@ -44,11 +44,11 @@ final class DiffusionMercurialHistoryQuery extends DiffusionHistoryQuery {
}
list($stdout) = $repository->execxLocalCommand(
'log --debug --template %s --limit %d %C --rev %s::0 %C',
'log --debug --template %s --limit %d %C --rev %s %C',
'{node};{parents}\\n',
($this->getOffset() + $this->getLimit()), // No '--skip' in Mercurial.
$branch_arg,
$commit_hash,
hgsprintf('reverse(%s::%s)', '0', $commit_hash),
$path_arg);
$lines = explode("\n", trim($stdout));

View file

@ -10,9 +10,9 @@ final class DiffusionMercurialLastModifiedQuery
$path = $drequest->getPath();
list($hash) = $repository->execxLocalCommand(
'log --template %s --limit 1 --rev %s::0 -- %s',
'log --template %s --limit 1 --rev %s -- %s',
'{node}',
$drequest->getCommit(),
hgsprintf('reverse(%s::%s)', '0', $drequest->getCommit()),
nonempty(ltrim($path, '/'), '.'));
$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(