From b9ba0418ed13aba78ea95ebee14cdbbb43cc810f Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 4 Sep 2021 17:31:45 -0700 Subject: [PATCH] Correct a parameter order swap in "diffusion.historyquery" for Mercurial Summary: Ref T13666. See T13666#256253. The order of these parameters is incorrect (introduced in D18817, which was trying to turn the revset "A or B" into "B or A"), but when "commit" is the single head of "branch" (which is common), the revset is functionally equivalent. Test Plan: An easy reproduction case is to make a "diffusion.historyquery" call manually against a Mercurial repository, with a valid "branch" name and some non-head "commit". - Before patch, queried "head^" (by commit hash, not by symbol) of "default" and got "head" too (wrong). - Applied patch to `secure001.phacility.net` (my local `hg` web environment is iffy right now). - Re-ran the same query, saw "head^" as the first result rather than "head" (all hashes rather than symbols, as above), which is desired. Reviewers: cspeckmim Reviewed By: cspeckmim Maniphest Tasks: T13666 Differential Revision: https://secure.phabricator.com/D21722 --- .../diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php index a7e9494a80..c6ae6dbd2f 100644 --- a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php @@ -145,8 +145,8 @@ final class DiffusionHistoryQueryConduitAPIMethod } else { $revset_arg = hgsprintf( 'reverse(ancestors(%s)) and branch(%s)', - $drequest->getBranch(), - $commit_hash); + $commit_hash, + $drequest->getBranch()); } $hg_analyzer = PhutilBinaryAnalyzer::getForBinary('hg'); -- 2.11.4.GIT