Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14352090
D12496.id30007.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12496.id30007.diff
View Options
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -280,46 +280,6 @@
return $this;
}
- public function loadInlineComments(
- array &$changesets,
- PhabricatorUser $viewer) {
- assert_instances_of($changesets, 'DifferentialChangeset');
-
- $inline_comments = array();
-
- $inline_comments = id(new DifferentialInlineCommentQuery())
- ->setViewer($viewer)
- ->withDrafts(false)
- ->withRevisionPHIDs(array($this->getPHID()))
- ->execute();
-
- $load_changesets = array();
- foreach ($inline_comments as $inline) {
- $changeset_id = $inline->getChangesetID();
- if (isset($changesets[$changeset_id])) {
- continue;
- }
- $load_changesets[$changeset_id] = true;
- }
-
- $more_changesets = array();
- if ($load_changesets) {
- $changeset_ids = array_keys($load_changesets);
- $more_changesets += id(new DifferentialChangeset())
- ->loadAllWhere(
- 'id IN (%Ld)',
- $changeset_ids);
- }
-
- if ($more_changesets) {
- $changesets += $more_changesets;
- $changesets = msort($changesets, 'getSortKey');
- }
-
- return $inline_comments;
- }
-
-
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -531,14 +491,23 @@
$left_diff = $diffs[$left];
$right_diff = $diffs[$right];
- $changesets = id(new DifferentialChangesetQuery())
- ->setViewer($request->getUser())
- ->withDiffs(array($right_diff))
- ->execute();
- // NOTE: this mutates $changesets to include changesets for all inline
- // comments...!
- $inlines = $this->loadInlineComments($changesets, $request->getViewer());
- $changesets = mpull($changesets, null, 'getID');
+ $type_inline = DifferentialTransaction::TYPE_INLINE;
+ $changeset_ids = array();
+ foreach ($timeline->getTransactions() as $xaction) {
+ if ($xaction->getTransactionType() == $type_inline) {
+ $changeset_ids[] = $xaction->getComment()->getChangesetID();
+ }
+ }
+
+ if ($changeset_ids) {
+ $changesets = id(new DifferentialChangesetQuery())
+ ->setViewer($request->getUser())
+ ->withIDs($changeset_ids)
+ ->execute();
+ $changesets = mpull($changesets, null, 'getID');
+ } else {
+ $changesets = array();
+ }
return $timeline
->setChangesets($changesets)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 12:57 PM (19 h, 53 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6910421
Default Alt Text
D12496.id30007.diff (2 KB)
Attached To
Mode
D12496: Simplify timeline rendering on Differential revisions
Attached
Detach File
Event Timeline
Log In to Comment