@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make all revision status readers explicitly read modern or legacy status

Summary: Ref T2543. All writers now write modern statuses. Make all readers explicit about whether they are reading modern or legacy statuses, so I can swap the storage format.

Test Plan:
- Grepped for `getStatus()`, scanned the list. Other applications have methods with this name so it's possible I missed something.
- Browed around, changed revision statuses.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2543

Differential Revision: https://secure.phabricator.com/D18417

+12 -11
+1 -1
src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
··· 82 82 'authorPHID' => $revision->getAuthorPHID(), 83 83 'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()), 84 84 'title' => $revision->getTitle(), 85 - 'status' => $revision->getStatus(), 85 + 'status' => $revision->getLegacyRevisionStatus(), 86 86 'statusName' => $revision->getStatusDisplayName(), 87 87 'summary' => $revision->getSummary(), 88 88 'testPlan' => $revision->getTestPlan(),
+1 -1
src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
··· 218 218 'dateCreated' => $revision->getDateCreated(), 219 219 'dateModified' => $revision->getDateModified(), 220 220 'authorPHID' => $revision->getAuthorPHID(), 221 - 'status' => $revision->getStatus(), 221 + 'status' => $revision->getLegacyRevisionStatus(), 222 222 'statusName' => $revision->getStatusDisplayName(), 223 223 'properties' => $revision->getProperties(), 224 224 'branch' => $diff->getBranch(),
+2 -2
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 535 535 return $xactions; 536 536 } 537 537 538 - $old_legacy_status = $revision->getStatus(); 538 + $old_legacy_status = $revision->getLegacyRevisionStatus(); 539 539 $revision->setModernRevisionStatus($new_status); 540 - $new_legacy_status = $revision->getStatus(); 540 + $new_legacy_status = $revision->getLegacyRevisionStatus(); 541 541 if ($new_legacy_status == $old_legacy_status) { 542 542 return $xactions; 543 543 }
+2 -5
src/applications/differential/phid/DifferentialRevisionPHIDType.php
··· 33 33 $revision = $objects[$phid]; 34 34 35 35 $title = $revision->getTitle(); 36 - $status = $revision->getStatus(); 37 36 $monogram = $revision->getMonogram(); 38 37 $uri = $revision->getURI(); 39 38 ··· 46 45 $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); 47 46 } 48 47 49 - $status = $revision->getStatus(); 50 - 51 - $icon = $revision->getStatusIcon($status); 52 - $color = $revision->getStatusIconColor($status); 48 + $icon = $revision->getStatusIcon(); 49 + $color = $revision->getStatusIconColor(); 53 50 $name = $revision->getStatusDisplayName(); 54 51 55 52 $handle
+4
src/applications/differential/storage/DifferentialRevision.php
··· 631 631 return $this->getStatusObject()->getKey(); 632 632 } 633 633 634 + public function getLegacyRevisionStatus() { 635 + return $this->getStatus(); 636 + } 637 + 634 638 public function isClosed() { 635 639 return $this->getStatusObject()->isClosedStatus(); 636 640 }
+2 -2
src/applications/differential/xaction/DifferentialRevisionStatusTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'differential.revision.status'; 7 7 8 8 public function generateOldValue($object) { 9 - return $object->getStatus(); 9 + return $object->getLegacyRevisionStatus(); 10 10 } 11 11 12 12 public function applyInternalEffects($object, $value) { 13 - $object->setStatus($value); 13 + $object->setLegacyRevisionStatus($value); 14 14 } 15 15 16 16 public function getTitle() {