Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F91430
D7807.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7807.diff
View Options
diff --git a/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php b/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php
--- a/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php
+++ b/src/applications/diffusion/herald/HeraldPreCommitContentAdapter.php
@@ -50,6 +50,7 @@
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 @@
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
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -30,6 +30,7 @@
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 @@
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 @@
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
--- a/src/applications/herald/adapter/HeraldCommitAdapter.php
+++ b/src/applications/herald/adapter/HeraldCommitAdapter.php
@@ -336,6 +336,16 @@
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) {
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/wz/di/f6pscdal2o444swn
Default Alt Text
D7807.diff (3 KB)
Attached To
Mode
D7807: Add an "Accepted Differential revision" field to Commit and pre-commit Content Herald rules
Attached
Detach File
Event Timeline
Log In to Comment