Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/phid/DifferentialPHIDTypeRevision.php
Show All 23 Lines | return id(new DifferentialRevisionQuery()) | ||||
->withPHIDs($phids); | ->withPHIDs($phids); | ||||
} | } | ||||
public function loadHandles( | public function loadHandles( | ||||
PhabricatorHandleQuery $query, | PhabricatorHandleQuery $query, | ||||
array $handles, | array $handles, | ||||
array $objects) { | array $objects) { | ||||
static $closed_statuses = array( | |||||
ArcanistDifferentialRevisionStatus::CLOSED => true, | |||||
ArcanistDifferentialRevisionStatus::ABANDONED => true, | |||||
); | |||||
foreach ($handles as $phid => $handle) { | foreach ($handles as $phid => $handle) { | ||||
$revision = $objects[$phid]; | $revision = $objects[$phid]; | ||||
$title = $revision->getTitle(); | $title = $revision->getTitle(); | ||||
$id = $revision->getID(); | $id = $revision->getID(); | ||||
$status = $revision->getStatus(); | $status = $revision->getStatus(); | ||||
$handle->setName("D{$id}"); | $handle->setName("D{$id}"); | ||||
$handle->setURI("/D{$id}"); | $handle->setURI("/D{$id}"); | ||||
$handle->setFullName("D{$id}: {$title}"); | $handle->setFullName("D{$id}: {$title}"); | ||||
if (isset($closed_statuses[$status])) { | if ($revision->isClosed()) { | ||||
$handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED); | $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
public function canLoadNamedObject($name) { | public function canLoadNamedObject($name) { | ||||
return preg_match('/^D\d*[1-9]\d*$/i', $name); | return preg_match('/^D\d*[1-9]\d*$/i', $name); | ||||
} | } | ||||
Show All 27 Lines |