From 37b1ac5a240553ee29c7a9af760f554d83f6a5ba Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 29 May 2012 11:23:23 -0700 Subject: [PATCH] Load changesets with inline comments in large diffs Summary: Also fix the notice text. Test Plan: Display diff with inline comments and lint errors. Click on inline comment and lint link. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2594 --- .../DifferentialRevisionViewController.php | 22 +++++++++++++++++-- .../DifferentialRevisionCommentView.php | 1 - 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index 9e717afebd..138b7c8fcd 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -71,6 +71,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $target_manual, array( 'local:commits', + 'arc:lint', 'arc:unit', )); @@ -177,8 +178,8 @@ final class DifferentialRevisionViewController extends DifferentialController { $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); $warning->setWidth(AphrontErrorView::WIDTH_WIDE); $warning->appendChild( - "

This diff is very large and affects {$count} files. Use ". - "Table of Contents to open files in a standalone view. ". + "

This diff is very large and affects {$count} files. Load ". + "each file individually. ". "". phutil_render_tag( 'a', @@ -192,6 +193,23 @@ final class DifferentialRevisionViewController extends DifferentialController { $warning = $warning->render(); $visible_changesets = array(); + foreach ($inlines as $inline) { + $changeset_id = $inline->getChangesetID(); + if (isset($changesets[$changeset_id])) { + $visible_changesets[$changeset_id] = $changesets[$changeset_id]; + } + } + + if (!empty($props['arc:lint'])) { + $changeset_paths = mpull($changesets, null, 'getFilename'); + foreach ($props['arc:lint'] as $lint) { + $changeset = idx($changeset_paths, $lint['path']); + if ($changeset) { + $visible_changesets[$changeset->getID()] = $changeset; + } + } + } + } else { $warning = null; $visible_changesets = $changesets; diff --git a/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php b/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php index aa002b5736..745582f353 100644 --- a/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php +++ b/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php @@ -294,7 +294,6 @@ final class DifferentialRevisionCommentView extends AphrontView { $item['href'] = 'D'.$this->comment->getRevisionID(). '?id='.$diff_id. - '&large=true'. '#inline-'.$inline->getID(); }