]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Dispatch event after building diff message
authorvrana <jakubv@fb.com>
Tue, 28 Aug 2012 01:21:49 +0000 (18:21 -0700)
committervrana <jakubv@fb.com>
Tue, 28 Aug 2012 01:34:31 +0000 (18:34 -0700)
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
src/workflow/ArcanistDiffWorkflow.php

index 37879396208d1a3cd1b04cd494fdbe7a97c85f16..35a116cc514915f70decd1078610913628b1d481 100644 (file)
@@ -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';
 
 }
index 8a7f1d255691e88d5af110340c05a53d785c943d..8cc4c60b7cb2d6687d716ac4a546160777257e93 100644 (file)
@@ -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);
     }