mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Fix Mercurial "Last Modified" query
Summary: To determine when a file was last modified, we currently run `hg log ... -b branch ... file`. However, this is incorrect, because Mercurial does not interpret "-b x" as "all ancestors of the commit named x" like Git does, and we don't care about where the modification happened anyway (we always have a resolved commit as a starting point). I think this got copy-pasta'd from the History query. Instead, drop the branch-specific qualifier and find the last modification, period. Test Plan: Mercurial commit views of commits not on the repository's default branch are no longer broken. Reviewers: DurhamGoode, vrana, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5146
This commit is contained in:
parent
8fead36615
commit
e5122877a5
1 changed files with 1 additions and 3 deletions
|
@ -9,11 +9,9 @@ final class DiffusionMercurialLastModifiedQuery
|
|||
|
||||
$path = $drequest->getPath();
|
||||
|
||||
// TODO: Share some of this with History query.
|
||||
list($hash) = $repository->execxLocalCommand(
|
||||
'log --template %s --limit 1 -b %s --rev %s:0 -- %s',
|
||||
'log --template %s --limit 1 --rev %s:0 -- %s',
|
||||
'{node}',
|
||||
$drequest->getBranch(),
|
||||
$drequest->getCommit(),
|
||||
nonempty(ltrim($path, '/'), '.'));
|
||||
|
||||
|
|
Loading…
Reference in a new issue