Page MenuHomePhabricator

D15084.diff
No OneTemporary

D15084.diff

diff --git a/src/differential/constants/ArcanistDifferentialRevisionStatus.php b/src/differential/constants/ArcanistDifferentialRevisionStatus.php
--- a/src/differential/constants/ArcanistDifferentialRevisionStatus.php
+++ b/src/differential/constants/ArcanistDifferentialRevisionStatus.php
@@ -9,6 +9,7 @@
const ABANDONED = 4;
const CHANGES_PLANNED = 5;
const IN_PREPARATION = 6;
+ const CLOSED_FROM_ACCEPTED = 7;
public static function getNameForRevisionStatus($status) {
$map = array(
@@ -19,6 +20,7 @@
self::ABANDONED => pht('Abandoned'),
self::CHANGES_PLANNED => pht('Changes Planned'),
self::IN_PREPARATION => pht('In Preparation'),
+ self::CLOSED_FROM_ACCEPTED => pht('Closed'),
);
return idx($map, coalesce($status, '?'), pht('Unknown'));
diff --git a/src/workflow/ArcanistCloseRevisionWorkflow.php b/src/workflow/ArcanistCloseRevisionWorkflow.php
--- a/src/workflow/ArcanistCloseRevisionWorkflow.php
+++ b/src/workflow/ArcanistCloseRevisionWorkflow.php
@@ -98,6 +98,8 @@
$status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
$status_closed = ArcanistDifferentialRevisionStatus::CLOSED;
+ $status_closed_accepted =
+ ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED;
if (!$is_finalize && $revision['status'] != $status_accepted) {
throw new ArcanistUsageException(
@@ -142,7 +144,12 @@
}
$status = $revision['status'];
- if ($status == $status_accepted || $status == $status_closed) {
+ $good_states = array(
+ $status_accepted => true,
+ $status_closed => true,
+ $status_closed_accepted => true,
+ );
+ if (idx($good_states, $status)) {
// If this has already been attached to commits, don't show the
// "you can push this commit" message since we know it's been pushed
// already.
diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php
--- a/src/workflow/ArcanistPatchWorkflow.php
+++ b/src/workflow/ArcanistPatchWorkflow.php
@@ -1065,7 +1065,9 @@
$found_revision = null;
$revisions = isort($revisions, 'dateModified');
foreach ($revisions as $revision) {
- if ($revision['status'] == ArcanistDifferentialRevisionStatus::CLOSED) {
+ $status = $revision['status'];
+ if ($status == ArcanistDifferentialRevisionStatus::CLOSED ||
+ $status == ArcanistDifferentialRevisionStatus::CLOSED_FROM_ACCEPTED) {
$found_revision = $revision;
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 2, 2:56 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721891
Default Alt Text
D15084.diff (2 KB)

Event Timeline