diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php index d8c8f79a11..1845f6e2f3 100644 --- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php +++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php @@ -760,10 +760,15 @@ final class DiffusionCommitHookEngine extends Phobject { // repository that's already full of garbage (strongly discouraged but // not as inherently dangerous). These cases should be very uncommon. + // NOTE: We're only looking for heads on the same branch. The old + // tip of the branch may be the branchpoint for other branches, but that + // is OK. + $dfutures = array(); foreach ($old_heads as $old_head) { $dfutures[$old_head] = $repository->getLocalCommandFuture( - 'log --rev %s --template %s', + 'log --branch %s --rev %s --template %s', + $ref, hgsprintf('(descendants(%s) and head())', $old_head), '{node}\1'); }