Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14784349
D15085.id36424.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D15085.id36424.diff
View Options
diff --git a/src/applications/differential/constants/DifferentialRevisionStatus.php b/src/applications/differential/constants/DifferentialRevisionStatus.php
--- a/src/applications/differential/constants/DifferentialRevisionStatus.php
+++ b/src/applications/differential/constants/DifferentialRevisionStatus.php
@@ -27,6 +27,8 @@
self::COLOR_STATUS_GREEN,
ArcanistDifferentialRevisionStatus::CLOSED =>
self::COLOR_STATUS_DARK,
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED =>
+ self::COLOR_STATUS_DARK,
ArcanistDifferentialRevisionStatus::ABANDONED =>
self::COLOR_STATUS_DARK,
ArcanistDifferentialRevisionStatus::IN_PREPARATION =>
@@ -49,6 +51,8 @@
'fa-check green',
ArcanistDifferentialRevisionStatus::CLOSED =>
'fa-check-square-o',
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED =>
+ 'fa-check-square-o',
ArcanistDifferentialRevisionStatus::ABANDONED =>
'fa-check-square-o',
ArcanistDifferentialRevisionStatus::IN_PREPARATION =>
@@ -81,6 +85,7 @@
public static function getClosedStatuses() {
$statuses = array(
ArcanistDifferentialRevisionStatus::CLOSED,
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED,
ArcanistDifferentialRevisionStatus::ABANDONED,
);
@@ -102,6 +107,7 @@
ArcanistDifferentialRevisionStatus::CHANGES_PLANNED,
ArcanistDifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::CLOSED,
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED,
ArcanistDifferentialRevisionStatus::ABANDONED,
ArcanistDifferentialRevisionStatus::IN_PREPARATION,
);
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -116,6 +116,8 @@
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
$status_revision = ArcanistDifferentialRevisionStatus::NEEDS_REVISION;
$status_plan = ArcanistDifferentialRevisionStatus::CHANGES_PLANNED;
+ $status_closed_accepted =
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED;
$action_type = $xaction->getNewValue();
switch ($action_type) {
@@ -147,13 +149,15 @@
return $will_add_reviewer;
case DifferentialAction::ACTION_CLOSE:
- return ($object->getStatus() != $status_closed);
+ return ($object->getStatus() != $status_closed &&
+ $object->getStatus() != $status_closed_accepted);
case DifferentialAction::ACTION_ABANDON:
return ($object->getStatus() != $status_abandoned);
case DifferentialAction::ACTION_RECLAIM:
return ($object->getStatus() == $status_abandoned);
case DifferentialAction::ACTION_REOPEN:
- return ($object->getStatus() == $status_closed);
+ return ($object->getStatus() == $status_closed ||
+ $object->getStatus() == $status_closed_accepted);
case DifferentialAction::ACTION_RETHINK:
return ($object->getStatus() != $status_plan);
case DifferentialAction::ACTION_REQUEST:
@@ -177,6 +181,7 @@
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
+ $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
$status_revision = ArcanistDifferentialRevisionStatus::NEEDS_REVISION;
$status_plan = ArcanistDifferentialRevisionStatus::CHANGES_PLANNED;
@@ -232,7 +237,12 @@
$object->setStatus($status_review);
return;
case DifferentialAction::ACTION_CLOSE:
- $object->setStatus(ArcanistDifferentialRevisionStatus::CLOSED);
+ if ($object->getStatus() == $status_accepted) {
+ $object->setStatus(
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED);
+ } else {
+ $object->setStatus(ArcanistDifferentialRevisionStatus::CLOSED);
+ }
return;
case DifferentialAction::ACTION_CLAIM:
$object->setAuthorPHID($this->getActingAsPHID());
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
@@ -15,19 +15,18 @@
public function getHeraldFieldValue($object) {
$revision = $this->getAdapter()->loadDifferentialRevision();
+
if (!$revision) {
return null;
}
- $data = $object->getCommitData();
- $status = $data->getCommitDetail(
- 'precommitRevisionStatus',
- $revision->getStatus());
+ $status_accepted = array(
+ ArcanistDifferentialRevisionStatus::ACCEPTED => true,
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED => true,
+ );
- switch ($status) {
- case ArcanistDifferentialRevisionStatus::ACCEPTED:
- case ArcanistDifferentialRevisionStatus::CLOSED:
- return $revision->getPHID();
+ if (idx($status_accepted, $revision->getStatus())) {
+ 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
@@ -20,12 +20,16 @@
return null;
}
- $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
- if ($revision->getStatus() != $status_accepted) {
- return null;
+ $status_accepted = array(
+ ArcanistDifferentialRevisionStatus::ACCEPTED => true,
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED => true,
+ );
+
+ if (idx($status_accepted, $revision->getStatus())) {
+ return $revision->getPHID();
}
- return $revision->getPHID();
+ return null;
}
protected function getHeraldFieldStandardType() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 11:22 AM (14 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7050112
Default Alt Text
D15085.id36424.diff (6 KB)
Attached To
Mode
D15085: Revision substate CLOSED_FROM_ACCEPTED
Attached
Detach File
Event Timeline
Log In to Comment