1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-03 16:08:19 +02:00

Don't display "Loading..." for coverage which will never load

Summary: In very large diffs.

Test Plan:
Display very large diff.
Display normal diff.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1918
This commit is contained in:
vrana 2012-03-15 10:45:35 -07:00
parent 9f849b9fab
commit a70466a7fd
3 changed files with 11 additions and 3 deletions

View file

@ -105,7 +105,8 @@ final class DifferentialDiffViewController extends DifferentialController {
$changesets = msort($changesets, 'getSortKey'); $changesets = msort($changesets, 'getSortKey');
$table_of_contents = id(new DifferentialDiffTableOfContentsView()) $table_of_contents = id(new DifferentialDiffTableOfContentsView())
->setChangesets($changesets); ->setChangesets($changesets)
->setVisibleChangesets($changesets);
$refs = array(); $refs = array();
foreach ($changesets as $changeset) { foreach ($changesets as $changeset) {

View file

@ -267,6 +267,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$toc_view = new DifferentialDiffTableOfContentsView(); $toc_view = new DifferentialDiffTableOfContentsView();
$toc_view->setChangesets($changesets); $toc_view->setChangesets($changesets);
$toc_view->setVisibleChangesets($visible_changesets);
$toc_view->setUnitTestData(idx($props, 'arc:unit', array())); $toc_view->setUnitTestData(idx($props, 'arc:unit', array()));
if ($repository) { if ($repository) {
$toc_view->setRepository($repository); $toc_view->setRepository($repository);

View file

@ -19,6 +19,7 @@
final class DifferentialDiffTableOfContentsView extends AphrontView { final class DifferentialDiffTableOfContentsView extends AphrontView {
private $changesets = array(); private $changesets = array();
private $visibleChangesets = array();
private $repository; private $repository;
private $diff; private $diff;
private $user; private $user;
@ -33,6 +34,11 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
return $this; return $this;
} }
public function setVisibleChangesets($visible_changesets) {
$this->visibleChangesets = $visible_changesets;
return $this;
}
public function setRepository(PhabricatorRepository $repository) { public function setRepository(PhabricatorRepository $repository) {
$this->repository = $repository; $this->repository = $repository;
return $this; return $this;
@ -99,7 +105,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$changesets = $this->changesets; $changesets = $this->changesets;
$paths = array(); $paths = array();
foreach ($changesets as $changeset) { foreach ($changesets as $id => $changeset) {
$type = $changeset->getChangeType(); $type = $changeset->getChangeType();
$ftype = $changeset->getFileType(); $ftype = $changeset->getFileType();
$link = $this->renderChangesetLink($changeset); $link = $this->renderChangesetLink($changeset);
@ -163,7 +169,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
'id' => 'differential-mcoverage-'.md5($fname), 'id' => 'differential-mcoverage-'.md5($fname),
'class' => 'differential-mcoverage-loading', 'class' => 'differential-mcoverage-loading',
), ),
'Loading...'); (isset($this->visibleChangesets[$id]) ? 'Loading...' : '?'));
} }
$rows[] = $rows[] =