Move Differential's simple fields to the extensible field schema

Summary:
Differential has a bunch of display-only fields, implement them all as field
specifications instead of hard-coded fields.

Also add some more documentation and fix redundant string constants in blame
rev/revert plan fields.

Test Plan: Viewed, edited, and hit conduit for revisions.
Reviewed By: jungejason
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, jungejason, epriestley
Differential Revision: 807
This commit is contained in:
epriestley
2011-08-14 11:29:56 -07:00
parent e5ecd784ec
commit 52ec6c02ee
23 changed files with 465 additions and 40 deletions

View File

@@ -43,8 +43,6 @@ class DifferentialRevisionViewController extends DifferentialController {
"This revision has no diffs. Something has gone quite wrong.");
}
$aux_fields = $this->loadAuxiliaryFields($revision);
$diff_vs = $request->getInt('vs');
$target = end($diffs);
@@ -60,6 +58,11 @@ class DifferentialRevisionViewController extends DifferentialController {
$diff_vs = null;
}
$aux_fields = $this->loadAuxiliaryFields($revision);
foreach ($aux_fields as $aux_field) {
$aux_field->setDiff($target);
}
list($changesets, $vs_map, $rendering_references) =
$this->loadChangesetsAndVsMap($diffs, $diff_vs, $target);
@@ -336,17 +339,6 @@ class DifferentialRevisionViewController extends DifferentialController {
$handles,
$revision->getCCPHIDs()));
$host = $diff->getSourceMachine();
if ($host) {
$properties['Host'] = phutil_escape_html($host);
}
$path = $diff->getSourcePath();
if ($path) {
$branch = $diff->getBranch() ? ' ('.$diff->getBranch().')' : '';
$properties['Path'] = phutil_escape_html("{$path} {$branch}");
}
$lstar = DifferentialRevisionUpdateHistoryView::renderDiffLintStar($diff);
$lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff);
$ldata = idx($diff_properties, 'arc:lint');
@@ -474,18 +466,12 @@ class DifferentialRevisionViewController extends DifferentialController {
$properties['Commits'] = implode('<br />', $links);
}
$properties['Lines'] = number_format($diff->getLineCount());
$arcanist_phid = $diff->getArcanistProjectPHID();
if ($arcanist_phid) {
$properties['Arcanist Project'] = phutil_escape_html(
$handles[$arcanist_phid]->getName());
}
$properties['Apply Patch'] =
'<tt>arc patch D'.$revision->getID().'</tt>';
$properties['Export Patch'] =
'<tt>arc export --revision '.$revision->getID().'</tt>';
return $properties;
}