Show coverage percentages in table of contents

Summary:
Rough cut -- this needs style / color / tooltips, etc. Show raw coverage and "modified coverage" (coverage on lines you touched) in the table of contents.

https://secure.phabricator.com/file/data/id3apce5p5gevkee6tg2/PHID-FILE-kxcxlbsej454t4xiht2o/Screen_Shot_2012-03-12_at_3.30.30_PM.png

Test Plan: See screenshot above.

Reviewers: tuomaspelkonen, btrahan, zeeg

Reviewed By: tuomaspelkonen

CC: aran, epriestley

Maniphest Tasks: T965

Differential Revision: https://secure.phabricator.com/D1864
This commit is contained in:
epriestley
2012-03-12 17:06:55 -07:00
parent 09c1bd34f1
commit 85bdcbdd43
8 changed files with 217 additions and 56 deletions

View File

@@ -208,9 +208,17 @@ final class DifferentialChangesetViewController extends DifferentialController {
$output = $parser->render($range_s, $range_e, $mask);
$mcov = $parser->renderModifiedCoverage();
if ($request->isAjax()) {
$content = array(
'coverage' => array(
'differential-mcoverage-'.md5($changeset->getFilename()) => $mcov,
),
'changeset' => $output,
);
return id(new AphrontAjaxResponse())
->setContent($output);
->setContent($content);
}
Javelin::initBehavior('differential-show-more', array(

View File

@@ -68,6 +68,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$target,
array(
'local:commits',
'arc:unit',
));
list($changesets, $vs_map, $rendering_references) =
@@ -262,6 +263,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$toc_view = new DifferentialDiffTableOfContentsView();
$toc_view->setChangesets($changesets);
$toc_view->setUnitTestData(idx($props, 'arc:unit', array()));
if ($repository) {
$toc_view->setRepository($repository);
}