From a009c93350ed1fa8b5a938f2baf097f1095191d6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 22 May 2012 07:14:55 -0700 Subject: [PATCH] Use "-b", not "--branch", when issuing "hg log" in Phabricator Summary: Mercurial renamed "--only-branch" to "--branch" about two years ago. "-b" exists in both versions. http://www.selenic.com/pipermail/mercurial-devel/2010-April/020469.html We have a few other cases where we use features that exist only in recent Mercurial (notably, 'ancestors' in log) but we can work around this one easily. Test Plan: Looked at a Mercurial repo in Diffusion, verified that "log -b" commands issued and that the output was correct. Reviewers: btrahan, Makinde, ipalaus Reviewed By: ipalaus CC: aran Maniphest Tasks: T1264 Differential Revision: https://secure.phabricator.com/D2533 --- .../query/history/mercurial/DiffusionMercurialHistoryQuery.php | 3 ++- .../mercurial/DiffusionMercurialLastModifiedQuery.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/query/history/mercurial/DiffusionMercurialHistoryQuery.php b/src/applications/diffusion/query/history/mercurial/DiffusionMercurialHistoryQuery.php index 1cd3d0b4d2..c1aafb5e2e 100644 --- a/src/applications/diffusion/query/history/mercurial/DiffusionMercurialHistoryQuery.php +++ b/src/applications/diffusion/query/history/mercurial/DiffusionMercurialHistoryQuery.php @@ -32,8 +32,9 @@ final class DiffusionMercurialHistoryQuery extends DiffusionHistoryQuery { // in the log). $default_path = ''; + // NOTE: --branch used to be called --only-branch; use -b for compatibility. list($stdout) = $repository->execxLocalCommand( - 'log --debug --template %s --limit %d --branch %s --rev %s:0 -- %s', + 'log --debug --template %s --limit %d -b %s --rev %s:0 -- %s', '{node};{parents}\\n', ($this->getOffset() + $this->getLimit()), // No '--skip' in Mercurial. $drequest->getBranch(), diff --git a/src/applications/diffusion/query/lastmodified/mercurial/DiffusionMercurialLastModifiedQuery.php b/src/applications/diffusion/query/lastmodified/mercurial/DiffusionMercurialLastModifiedQuery.php index 3c55063830..ee8ae64e8b 100644 --- a/src/applications/diffusion/query/lastmodified/mercurial/DiffusionMercurialLastModifiedQuery.php +++ b/src/applications/diffusion/query/lastmodified/mercurial/DiffusionMercurialLastModifiedQuery.php @@ -27,7 +27,7 @@ final class DiffusionMercurialLastModifiedQuery // TODO: Share some of this with History query. list($hash) = $repository->execxLocalCommand( - 'log --template %s --limit 1 --branch %s --rev %s:0 -- %s', + 'log --template %s --limit 1 -b %s --rev %s:0 -- %s', '{node}', $drequest->getBranch(), $drequest->getCommit(),