1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

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
This commit is contained in:
epriestley 2014-05-14 16:59:02 -07:00
parent e841270677
commit fe0c98facc

View file

@ -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));
}
}