From 600e052e72fd39c42713eb3749f15b2e34c7a0c5 Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 27 Aug 2012 18:21:49 -0700 Subject: [PATCH] Dispatch event after building diff message Summary: We log time of running `arc diff`. It's easy with `--verbatim` or with users just confirming the message built in commit template. With `--background`, I want to log only waiting time, not message editing time. This event should allow it. Test Plan: $ arc diff Haven't created the listener yet. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3394 --- src/events/constant/ArcanistEventType.php | 1 + src/workflow/ArcanistDiffWorkflow.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/events/constant/ArcanistEventType.php b/src/events/constant/ArcanistEventType.php index 37879396..35a116cc 100644 --- a/src/events/constant/ArcanistEventType.php +++ b/src/events/constant/ArcanistEventType.php @@ -20,6 +20,7 @@ final class ArcanistEventType extends PhutilEventType { const TYPE_COMMIT_WILLCOMMITSVN = 'commit.willCommitSVN'; const TYPE_DIFF_WILLBUILDMESSAGE = 'diff.willBuildMessage'; + const TYPE_DIFF_DIDBUILDMESSAGE = 'diff.didBuildMessage'; const TYPE_DIFF_WASCREATED = 'diff.wasCreated'; } diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 8a7f1d25..8cc4c60b 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -383,6 +383,9 @@ EOTEXT $commit_message = $this->buildCommitMessage(); + PhutilEventEngine::dispatchEvent( + new PhutilEvent(ArcanistEventType::TYPE_DIFF_DIDBUILDMESSAGE)); + if (!$this->shouldOnlyCreateDiff()) { $revision = $this->buildRevisionFromCommitMessage($commit_message); }