From fe0c98faccbc3f78bfc62c5bc93e2b2b1e2bccc6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 14 May 2014 16:59:02 -0700 Subject: [PATCH] Pass correct number of parameters to pht() when closing a branch in Mercurial Summary: Ref T5050. This fixes the immediate error (bad pht()) but doesn't fix the other error (can't `--close-branch`) yet. Test Plan: Pushed a `--close-branch` commit, got a first-level error instead of an error about an error. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5050 Differential Revision: https://secure.phabricator.com/D9119 --- .../diffusion/engine/DiffusionCommitHookEngine.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php index 27842f7d94..748aa20d86 100644 --- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php +++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php @@ -737,19 +737,23 @@ final class DiffusionCommitHookEngine extends Phobject { if (!$new_heads) { if ($old_heads) { + // TODO: This comment is wrong, and branches can be deleted with + // --close-branch. Fix it soon: see T5050. // It looks like this push deletes a branch, but that isn't possible // in Mercurial, so something is going wrong here. Bail out. throw new Exception( pht( 'Mercurial repository has no new head for branch "%s" after '. - 'push. This is unexpected; rejecting change.')); + 'push. This is unexpected; rejecting change.', + $ref)); } else { // Obviously, this should never be possible either, as it makes // no sense. Explode. throw new Exception( pht( 'Mercurial repository has no new or old heads for branch "%s" '. - 'after push. This makes no sense; rejecting change.')); + 'after push. This makes no sense; rejecting change.', + $ref)); } }