Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/editor/PhabricatorAuditEditor.php
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | if ($reverts) { | ||||
$result[] = id(new PhabricatorAuditTransaction()) | $result[] = id(new PhabricatorAuditTransaction()) | ||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) | ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) | ||||
->setMetadataValue('edge:type', $reverts_edge) | ->setMetadataValue('edge:type', $reverts_edge) | ||||
->setNewValue(array('+' => $reverted_phids)); | ->setNewValue(array('+' => $reverted_phids)); | ||||
$phid_map[] = $reverted_phids; | $phid_map[] = $reverted_phids; | ||||
} | } | ||||
// See T13463. Copy "related task" edges from the associated revision, if | |||||
// one exists. | |||||
$revision = DiffusionCommitRevisionQuery::loadRevisionForCommit( | |||||
$actor, | |||||
$object); | |||||
if ($revision) { | |||||
$task_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | |||||
$revision->getPHID(), | |||||
DifferentialRevisionHasTaskEdgeType::EDGECONST); | |||||
$task_phids = array_fuse($task_phids); | |||||
if ($task_phids) { | |||||
$related_edge = DiffusionCommitHasTaskEdgeType::EDGECONST; | |||||
$result[] = id(new PhabricatorAuditTransaction()) | |||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) | |||||
->setMetadataValue('edge:type', $related_edge) | |||||
->setNewValue(array('+' => $task_phids)); | |||||
} | |||||
// Mark these objects as unmentionable, since the explicit relationship | |||||
// is stronger and any mentions are redundant. | |||||
$phid_map[] = $task_phids; | |||||
} | |||||
$phid_map = array_mergev($phid_map); | $phid_map = array_mergev($phid_map); | ||||
$this->addUnmentionablePHIDs($phid_map); | $this->addUnmentionablePHIDs($phid_map); | ||||
return $result; | return $result; | ||||
} | } | ||||
protected function buildReplyHandler(PhabricatorLiskDAO $object) { | protected function buildReplyHandler(PhabricatorLiskDAO $object) { | ||||
$reply_handler = new PhabricatorAuditReplyHandler(); | $reply_handler = new PhabricatorAuditReplyHandler(); | ||||
▲ Show 20 Lines • Show All 431 Lines • Show Last 20 Lines |