mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
Allow modification of the svn commit message via an event listener
Test Plan: Wrote an event listener modifying the commit message and the message was successfully changed. Reviewers: epriestley Reviewed By: epriestley CC: aran, jungejason, epriestley Differential Revision: 1103
This commit is contained in:
parent
53c64f64b0
commit
4ea0541aeb
3 changed files with 19 additions and 2 deletions
|
@ -17,4 +17,7 @@
|
|||
*/
|
||||
|
||||
final class ArcanistEventType extends PhutilEventType {
|
||||
|
||||
const TYPE_COMMIT_WILLCOMMITSVN = 'commit.willCommitSVN';
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue