Page MenuHomePhabricator

D15085.id36425.diff
No OneTemporary

D15085.id36425.diff

diff --git a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
@@ -59,7 +59,9 @@
throw new ConduitException('ERR_BAD_REVISION');
}
- if ($revision->getStatus() == ArcanistDifferentialRevisionStatus::CLOSED) {
+ $status = $revision->getStatus();
+ if ($status == ArcanistDifferentialRevisionStatus::CLOSED ||
+ $status == ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED) {
throw new ConduitException('ERR_CLOSED');
}
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/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -614,6 +614,7 @@
$actions[DifferentialAction::ACTION_CLOSE] = true;
break;
case ArcanistDifferentialRevisionStatus::CLOSED:
+ case ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED:
break;
case ArcanistDifferentialRevisionStatus::ABANDONED:
$actions[DifferentialAction::ACTION_RECLAIM] = true;
@@ -641,10 +642,12 @@
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
break;
case ArcanistDifferentialRevisionStatus::CLOSED:
+ case ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED:
case ArcanistDifferentialRevisionStatus::ABANDONED:
break;
}
- if ($status != ArcanistDifferentialRevisionStatus::CLOSED) {
+ if ($status != ArcanistDifferentialRevisionStatus::CLOSED &&
+ $status != ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED) {
$actions[DifferentialAction::ACTION_CLAIM] = true;
$actions[DifferentialAction::ACTION_CLOSE] = $always_allow_close;
}
@@ -653,7 +656,8 @@
$actions[DifferentialAction::ACTION_ADDREVIEWERS] = true;
$actions[DifferentialAction::ACTION_ADDCCS] = true;
$actions[DifferentialAction::ACTION_REOPEN] = $allow_reopen &&
- ($status == ArcanistDifferentialRevisionStatus::CLOSED);
+ ($status == ArcanistDifferentialRevisionStatus::CLOSED ||
+ $status == ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED);
$actions = array_keys(array_filter($actions));
$actions_dict = array();
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/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php
--- a/src/applications/differential/view/DifferentialRevisionListView.php
+++ b/src/applications/differential/view/DifferentialRevisionListView.php
@@ -177,6 +177,7 @@
$item->setStatusIcon('fa-check green', pht('Accepted'));
break;
case ArcanistDifferentialRevisionStatus::CLOSED:
+ case ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED:
$item->setDisabled(true);
$item->setStatusIcon('fa-check-square-o black', pht('Closed'));
break;
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() {
diff --git a/src/applications/drydock/operation/DrydockLandRepositoryOperation.php b/src/applications/drydock/operation/DrydockLandRepositoryOperation.php
--- a/src/applications/drydock/operation/DrydockLandRepositoryOperation.php
+++ b/src/applications/drydock/operation/DrydockLandRepositoryOperation.php
@@ -237,6 +237,7 @@
if ($revision->getStatus() != $status_accepted) {
switch ($revision->getStatus()) {
case ArcanistDifferentialRevisionStatus::CLOSED:
+ case ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED:
return array(
'title' => pht('Revision Closed'),
'body' => pht(
diff --git a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
--- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
+++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php
@@ -80,7 +80,8 @@
}
$status = $this->getRevision()->getStatus();
- if ($status == ArcanistDifferentialRevisionStatus::CLOSED) {
+ if ($status == ArcanistDifferentialRevisionStatus::CLOSED ||
+ $status == ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED) {
$verb = $tense[$this->releephAction]['past'];
} else {
$verb = $tense[$this->releephAction]['future'];
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
@@ -183,7 +183,11 @@
$commit->getPHID());
$status_closed = ArcanistDifferentialRevisionStatus::CLOSED;
- $should_close = ($revision->getStatus() != $status_closed) &&
+ $status_closed_accepted =
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED;
+ $status = $revision->getStatus();
+ $should_close = ($status != $status_closed &&
+ $status != $status_closed_accepted) &&
$should_autoclose;
if ($should_close) {

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 29, 4:30 PM (1 w, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7726303
Default Alt Text
D15085.id36425.diff (12 KB)

Event Timeline