1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +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:
Marek Sapota 2011-11-16 16:40:09 -08:00
parent 53c64f64b0
commit 4ea0541aeb
3 changed files with 19 additions and 2 deletions

View file

@ -17,4 +17,7 @@
*/
final class ArcanistEventType extends PhutilEventType {
const TYPE_COMMIT_WILLCOMMITSVN = 'commit.willCommitSVN';
}

View file

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

View file

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