diff --git a/src/events/constant/type/ArcanistEventType.php b/src/events/constant/type/ArcanistEventType.php index ea8abb5c..e9ce052d 100644 --- a/src/events/constant/type/ArcanistEventType.php +++ b/src/events/constant/type/ArcanistEventType.php @@ -17,4 +17,7 @@ */ final class ArcanistEventType extends PhutilEventType { + + const TYPE_COMMIT_WILLCOMMITSVN = 'commit.willCommitSVN'; + } diff --git a/src/workflow/commit/ArcanistCommitWorkflow.php b/src/workflow/commit/ArcanistCommitWorkflow.php index cd4a8829..b6413044 100644 --- a/src/workflow/commit/ArcanistCommitWorkflow.php +++ b/src/workflow/commit/ArcanistCommitWorkflow.php @@ -101,6 +101,8 @@ EOTEXT } } + $this->revisionID = $revision_id; + $revision = null; try { $revision = $conduit->callMethodSynchronous( @@ -139,6 +141,17 @@ EOTEXT 'edit' => false, )); + $event = new PhutilEvent( + ArcanistEventType::TYPE_COMMIT_WILLCOMMITSVN, + array( + 'message' => $message, + 'workflow' => $this + ) + ); + PhutilEventEngine::dispatchEvent($event); + + $message = $event->getValue('message'); + if ($this->getArgument('show')) { echo $message; return 0; @@ -173,8 +186,6 @@ EOTEXT )); $mark_workflow->run(); - $this->revisionID = $revision_id; - return $err; } diff --git a/src/workflow/commit/__init__.php b/src/workflow/commit/__init__.php index a63499f8..40166f22 100644 --- a/src/workflow/commit/__init__.php +++ b/src/workflow/commit/__init__.php @@ -6,12 +6,15 @@ +phutil_require_module('arcanist', 'events/constant/type'); phutil_require_module('arcanist', 'exception/usage'); phutil_require_module('arcanist', 'exception/usage/userabort'); phutil_require_module('arcanist', 'repository/api/base'); phutil_require_module('arcanist', 'workflow/base'); phutil_require_module('phutil', 'console'); +phutil_require_module('phutil', 'events/engine'); +phutil_require_module('phutil', 'events/event'); phutil_require_module('phutil', 'filesystem'); phutil_require_module('phutil', 'future/exec'); phutil_require_module('phutil', 'utils');