Page MenuHomePhabricator

D18416.id.diff
No OneTemporary

D18416.id.diff

diff --git a/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php
--- a/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php
+++ b/src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php
@@ -19,36 +19,15 @@
return null;
}
- $status = $revision->getStatus();
-
- switch ($status) {
- case ArcanistDifferentialRevisionStatus::ACCEPTED:
- return $revision->getPHID();
- case ArcanistDifferentialRevisionStatus::CLOSED:
- if ($revision->hasRevisionProperty(
- DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED)) {
-
- if ($revision->getProperty(
- DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED)) {
- return $revision->getPHID();
- } else {
- return null;
- }
- } else {
- // continue on to old-style precommitRevisionStatus
- break;
- }
- default:
- return null;
+ if ($revision->isAccepted()) {
+ return $revision->getPHID();
}
- $data = $object->getCommitData();
- $status = $data->getCommitDetail('precommitRevisionStatus');
-
- switch ($status) {
- case ArcanistDifferentialRevisionStatus::ACCEPTED:
- case ArcanistDifferentialRevisionStatus::CLOSED:
+ $was_accepted = DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED;
+ if ($revision->isPublished()) {
+ if ($revision->getProperty($was_accepted)) {
return $revision->getPHID();
+ }
}
return null;
diff --git a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php
--- a/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php
+++ b/src/applications/diffusion/herald/DiffusionPreCommitContentRevisionAcceptedHeraldField.php
@@ -15,21 +15,19 @@
public function getHeraldFieldValue($object) {
$revision = $this->getAdapter()->getRevision();
-
if (!$revision) {
return null;
}
- switch ($revision->getStatus()) {
- case ArcanistDifferentialRevisionStatus::ACCEPTED:
- return $revision->getPHID();
- case ArcanistDifferentialRevisionStatus::CLOSED:
- if ($revision->getProperty(
- DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED)) {
+ if ($revision->isAccepted()) {
+ return $revision->getPHID();
+ }
- return $revision->getPHID();
- }
- break;
+ $was_accepted = DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED;
+ if ($revision->isPublished()) {
+ if ($revision->getProperty($was_accepted)) {
+ return $revision->getPHID();
+ }
}
return null;
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -186,11 +186,6 @@
$revision = $revision_query->executeOne();
if ($revision) {
- if (!$data->getCommitDetail('precommitRevisionStatus')) {
- $data->setCommitDetail(
- 'precommitRevisionStatus',
- $revision->getStatus());
- }
$commit_drev = DiffusionCommitHasRevisionEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($commit->getPHID(), $commit_drev, $revision->getPHID())

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 10:34 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384975
Default Alt Text
D18416.id.diff (3 KB)

Event Timeline