Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13984173
D10316.id24974.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D10316.id24974.diff
View Options
diff --git a/src/applications/diffusion/herald/HeraldPreCommitAdapter.php b/src/applications/diffusion/herald/HeraldPreCommitAdapter.php
--- a/src/applications/diffusion/herald/HeraldPreCommitAdapter.php
+++ b/src/applications/diffusion/herald/HeraldPreCommitAdapter.php
@@ -72,16 +72,20 @@
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
- return array(
- self::ACTION_BLOCK,
- self::ACTION_EMAIL,
- self::ACTION_NOTHING
- );
+ return array_merge(
+ array(
+ self::ACTION_BLOCK,
+ self::ACTION_EMAIL,
+ self::ACTION_NOTHING,
+ ),
+ parent::getActions($rule_type));
case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
- return array(
- self::ACTION_EMAIL,
- self::ACTION_NOTHING,
- );
+ return array_merge(
+ array(
+ self::ACTION_EMAIL,
+ self::ACTION_NOTHING,
+ ),
+ parent::getActions($rule_type));
}
}
@@ -118,7 +122,15 @@
pht('Blocked push.'));
break;
default:
- throw new Exception(pht('No rules to handle action "%s"!', $action));
+ $custom_result = parent::handleCustomHeraldEffect($effect);
+ if ($custom_result === null) {
+ throw new Exception(pht(
+ "No rules to handle action '%s'.",
+ $action));
+ }
+
+ $result[] = $custom_result;
+ break;
}
}
diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php
--- a/src/applications/herald/adapter/HeraldCommitAdapter.php
+++ b/src/applications/herald/adapter/HeraldCommitAdapter.php
@@ -544,7 +544,9 @@
default:
$custom_result = parent::handleCustomHeraldEffect($effect);
if ($custom_result === null) {
- throw new Exception("No rules to handle action '{$action}'.");
+ throw new Exception(pht(
+ "No rules to handle action '%s'.",
+ $action));
}
$result[] = $custom_result;
diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
--- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
+++ b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
@@ -422,7 +422,9 @@
default:
$custom_result = parent::handleCustomHeraldEffect($effect);
if ($custom_result === null) {
- throw new Exception("No rules to handle action '{$action}'.");
+ throw new Exception(pht(
+ "No rules to handle action '%s'.",
+ $action));
}
$result[] = $custom_result;
diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
--- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
+++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
@@ -207,7 +207,9 @@
default:
$custom_result = parent::handleCustomHeraldEffect($effect);
if ($custom_result === null) {
- throw new Exception("No rules to handle action '{$action}'.");
+ throw new Exception(pht(
+ "No rules to handle action '%s'.",
+ $action));
}
$result[] = $custom_result;
diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
--- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
@@ -139,7 +139,9 @@
default:
$custom_result = parent::handleCustomHeraldEffect($effect);
if ($custom_result === null) {
- throw new Exception("No rules to handle action '{$action}'.");
+ throw new Exception(pht(
+ "No rules to handle action '%s'.",
+ $action));
}
$result[] = $custom_result;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 21, 11:28 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735288
Default Alt Text
D10316.id24974.diff (4 KB)
Attached To
Mode
D10316: Allow pre-commit adapter to use custom actions
Attached
Detach File
Event Timeline
Log In to Comment