Differential D15916 Diff 38332 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Show First 20 Lines • Show All 1,571 Lines • ▼ Show 20 Lines | private function combineTransactions(array $xactions) { | ||||
$stray_comments = array(); | $stray_comments = array(); | ||||
$result = array(); | $result = array(); | ||||
$types = array(); | $types = array(); | ||||
foreach ($xactions as $key => $xaction) { | foreach ($xactions as $key => $xaction) { | ||||
$type = $xaction->getTransactionType(); | $type = $xaction->getTransactionType(); | ||||
if (isset($types[$type])) { | if (isset($types[$type])) { | ||||
foreach ($types[$type] as $other_key) { | foreach ($types[$type] as $other_key) { | ||||
$other_xaction = $result[$other_key]; | |||||
// Don't merge transactions with different authors. For example, | |||||
// don't merge Herald transactions and owners transactions. | |||||
if ($other_xaction->getAuthorPHID() != $xaction->getAuthorPHID()) { | |||||
continue; | |||||
} | |||||
$merged = $this->mergeTransactions($result[$other_key], $xaction); | $merged = $this->mergeTransactions($result[$other_key], $xaction); | ||||
if ($merged) { | if ($merged) { | ||||
$result[$other_key] = $merged; | $result[$other_key] = $merged; | ||||
if ($xaction->getComment() && | if ($xaction->getComment() && | ||||
($xaction->getComment() !== $merged->getComment())) { | ($xaction->getComment() !== $merged->getComment())) { | ||||
$stray_comments[] = $xaction->getComment(); | $stray_comments[] = $xaction->getComment(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,958 Lines • Show Last 20 Lines |