diff --git a/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php b/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php index db9f478b34..50793ac941 100644 --- a/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php +++ b/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php @@ -50,6 +50,7 @@ final class HeraldPreCommitContentAdapter extends HeraldAdapter { self::FIELD_PUSHER, self::FIELD_PUSHER_PROJECTS, self::FIELD_DIFFERENTIAL_REVISION, + self::FIELD_DIFFERENTIAL_ACCEPTED, self::FIELD_DIFFERENTIAL_REVIEWERS, self::FIELD_DIFFERENTIAL_CCS, self::FIELD_RULE, @@ -118,6 +119,16 @@ final class HeraldPreCommitContentAdapter extends HeraldAdapter { return null; } return $revision->getPHID(); + case self::FIELD_DIFFERENTIAL_ACCEPTED: + $revision = $this->getRevision(); + if (!$revision) { + return null; + } + $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; + if ($revision->getStatus() != $status_accepted) { + return null; + } + return $revision->getPHID(); case self::FIELD_DIFFERENTIAL_REVIEWERS: $revision = $this->getRevision(); if (!$revision) { diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php index 00cdb5e1de..d0eb235414 100644 --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -30,6 +30,7 @@ abstract class HeraldAdapter { const FIELD_DIFFERENTIAL_REVISION = 'differential-revision'; const FIELD_DIFFERENTIAL_REVIEWERS = 'differential-reviewers'; const FIELD_DIFFERENTIAL_CCS = 'differential-ccs'; + const FIELD_DIFFERENTIAL_ACCEPTED = 'differential-accepted'; const CONDITION_CONTAINS = 'contains'; const CONDITION_NOT_CONTAINS = '!contains'; @@ -169,6 +170,8 @@ abstract class HeraldAdapter { self::FIELD_DIFFERENTIAL_REVISION => pht('Differential revision'), self::FIELD_DIFFERENTIAL_REVIEWERS => pht('Differential reviewers'), self::FIELD_DIFFERENTIAL_CCS => pht('Differential CCs'), + self::FIELD_DIFFERENTIAL_ACCEPTED + => pht('Accepted Differential revision'), ); } @@ -284,6 +287,7 @@ abstract class HeraldAdapter { self::CONDITION_INCLUDE_NONE, ); case self::FIELD_DIFFERENTIAL_REVISION: + case self::FIELD_DIFFERENTIAL_ACCEPTED: return array( self::CONDITION_EXISTS, self::CONDITION_NOT_EXISTS, diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php index ecc80ee264..8e30e855de 100644 --- a/src/applications/herald/adapter/HeraldCommitAdapter.php +++ b/src/applications/herald/adapter/HeraldCommitAdapter.php @@ -336,6 +336,16 @@ final class HeraldCommitAdapter extends HeraldAdapter { return null; } return $revision->getID(); + case self::FIELD_DIFFERENTIAL_ACCEPTED: + $revision = $this->loadDifferentialRevision(); + if (!$revision) { + return null; + } + $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; + if ($revision->getStatus() != $status_accepted) { + return null; + } + return $revision->getPHID(); case self::FIELD_DIFFERENTIAL_REVIEWERS: $revision = $this->loadDifferentialRevision(); if (!$revision) {