From e5122877a55d3b9ac2e22ff912ea513222d9334b Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 27 Feb 2013 18:41:29 -0800 Subject: [PATCH] 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 --- .../lastmodified/DiffusionMercurialLastModifiedQuery.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/applications/diffusion/query/lastmodified/DiffusionMercurialLastModifiedQuery.php b/src/applications/diffusion/query/lastmodified/DiffusionMercurialLastModifiedQuery.php index 728814b0ab..5a5f686351 100644 --- a/src/applications/diffusion/query/lastmodified/DiffusionMercurialLastModifiedQuery.php +++ b/src/applications/diffusion/query/lastmodified/DiffusionMercurialLastModifiedQuery.php @@ -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, '/'), '.'));