2011-03-11 18:34:22 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2012-01-19 20:49:51 +01:00
|
|
|
* Copyright 2012 Facebook, Inc.
|
2011-03-11 18:34:22 +01:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class DiffusionCommitController extends DiffusionController {
|
|
|
|
|
2011-04-07 23:55:06 +02:00
|
|
|
const CHANGES_LIMIT = 100;
|
|
|
|
|
2011-03-11 18:34:22 +01:00
|
|
|
public function processRequest() {
|
2011-03-14 00:19:39 +01:00
|
|
|
$drequest = $this->getDiffusionRequest();
|
2011-04-07 23:55:06 +02:00
|
|
|
$request = $this->getRequest();
|
2011-06-18 22:07:02 +02:00
|
|
|
$user = $request->getUser();
|
2011-03-11 18:34:22 +01:00
|
|
|
|
2011-03-31 04:22:11 +02:00
|
|
|
$callsign = $drequest->getRepository()->getCallsign();
|
|
|
|
|
2011-03-14 00:19:39 +01:00
|
|
|
$content = array();
|
|
|
|
$content[] = $this->buildCrumbs(array(
|
|
|
|
'commit' => true,
|
|
|
|
));
|
2011-03-11 18:34:22 +01:00
|
|
|
|
|
|
|
$detail_panel = new AphrontPanelView();
|
2011-03-14 04:12:17 +01:00
|
|
|
|
|
|
|
$repository = $drequest->getRepository();
|
|
|
|
$commit = $drequest->loadCommit();
|
2011-03-27 08:52:09 +02:00
|
|
|
|
|
|
|
if (!$commit) {
|
|
|
|
// TODO: Make more user-friendly.
|
|
|
|
throw new Exception('This commit has not parsed yet.');
|
|
|
|
}
|
|
|
|
|
2011-03-14 04:12:17 +01:00
|
|
|
$commit_data = $drequest->loadCommitData();
|
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$is_foreign = $commit_data->getCommitDetail('foreign-svn-stub');
|
|
|
|
if ($is_foreign) {
|
|
|
|
$subpath = $commit_data->getCommitDetail('svn-subpath');
|
|
|
|
|
|
|
|
$error_panel = new AphrontErrorView();
|
|
|
|
$error_panel->setWidth(AphrontErrorView::WIDTH_WIDE);
|
|
|
|
$error_panel->setTitle('Commit Not Tracked');
|
|
|
|
$error_panel->setSeverity(AphrontErrorView::SEVERITY_WARNING);
|
|
|
|
$error_panel->appendChild(
|
|
|
|
"This Diffusion repository is configured to track only one ".
|
|
|
|
"subdirectory of the entire Subversion repository, and this commit ".
|
|
|
|
"didn't affect the tracked subdirectory ('".
|
|
|
|
phutil_escape_html($subpath)."'), so no information is available.");
|
|
|
|
$content[] = $error_panel;
|
|
|
|
} else {
|
|
|
|
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
|
|
|
|
|
|
|
|
require_celerity_resource('diffusion-commit-view-css');
|
|
|
|
require_celerity_resource('phabricator-remarkup-css');
|
|
|
|
|
|
|
|
$property_table = $this->renderPropertyTable($commit, $commit_data);
|
|
|
|
|
|
|
|
$detail_panel->appendChild(
|
|
|
|
'<div class="diffusion-commit-view">'.
|
|
|
|
'<div class="diffusion-commit-dateline">'.
|
|
|
|
'r'.$callsign.$commit->getCommitIdentifier().
|
|
|
|
' · '.
|
|
|
|
phabricator_datetime($commit->getEpoch(), $user).
|
|
|
|
'</div>'.
|
|
|
|
'<h1>Revision Detail</h1>'.
|
|
|
|
'<div class="diffusion-commit-details">'.
|
|
|
|
$property_table.
|
|
|
|
'<hr />'.
|
|
|
|
'<div class="diffusion-commit-message phabricator-remarkup">'.
|
|
|
|
$engine->markupText($commit_data->getCommitMessage()).
|
|
|
|
'</div>'.
|
2011-03-14 04:12:17 +01:00
|
|
|
'</div>'.
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
'</div>');
|
2011-03-11 18:34:22 +01:00
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$content[] = $detail_panel;
|
|
|
|
}
|
2011-03-14 00:19:39 +01:00
|
|
|
|
2012-02-24 22:02:14 +01:00
|
|
|
$content[] = $this->buildAuditTable($commit);
|
|
|
|
|
2011-03-14 00:19:39 +01:00
|
|
|
$change_query = DiffusionPathChangeQuery::newFromDiffusionRequest(
|
|
|
|
$drequest);
|
|
|
|
$changes = $change_query->loadChanges();
|
|
|
|
|
2011-04-07 23:55:06 +02:00
|
|
|
$original_changes_count = count($changes);
|
|
|
|
if ($request->getStr('show_all') !== 'true' &&
|
|
|
|
$original_changes_count > self::CHANGES_LIMIT) {
|
|
|
|
$changes = array_slice($changes, 0, self::CHANGES_LIMIT);
|
|
|
|
}
|
|
|
|
|
2011-03-11 18:34:22 +01:00
|
|
|
$change_table = new DiffusionCommitChangeTableView();
|
|
|
|
$change_table->setDiffusionRequest($drequest);
|
2011-03-14 00:19:39 +01:00
|
|
|
$change_table->setPathChanges($changes);
|
2011-03-11 18:34:22 +01:00
|
|
|
|
2011-04-07 23:55:06 +02:00
|
|
|
$count = count($changes);
|
2011-03-19 22:38:50 +01:00
|
|
|
|
2011-03-27 08:52:09 +02:00
|
|
|
$bad_commit = null;
|
|
|
|
if ($count == 0) {
|
|
|
|
$bad_commit = queryfx_one(
|
|
|
|
id(new PhabricatorRepository())->establishConnection('r'),
|
|
|
|
'SELECT * FROM %T WHERE fullCommitName = %s',
|
|
|
|
PhabricatorRepository::TABLE_BADCOMMIT,
|
2011-03-31 04:22:11 +02:00
|
|
|
'r'.$callsign.$commit->getCommitIdentifier());
|
2011-03-27 08:52:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($bad_commit) {
|
|
|
|
$error_panel = new AphrontErrorView();
|
|
|
|
$error_panel->setWidth(AphrontErrorView::WIDTH_WIDE);
|
|
|
|
$error_panel->setTitle('Bad Commit');
|
|
|
|
$error_panel->appendChild(
|
|
|
|
phutil_escape_html($bad_commit['description']));
|
|
|
|
|
|
|
|
$content[] = $error_panel;
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
} else if ($is_foreign) {
|
|
|
|
// Don't render anything else.
|
|
|
|
} else if (!count($changes)) {
|
|
|
|
$no_changes = new AphrontErrorView();
|
|
|
|
$no_changes->setWidth(AphrontErrorView::WIDTH_WIDE);
|
|
|
|
$no_changes->setSeverity(AphrontErrorView::SEVERITY_WARNING);
|
|
|
|
$no_changes->setTitle('Not Yet Parsed');
|
|
|
|
// TODO: This can also happen with weird SVN changes that don't do
|
|
|
|
// anything (or only alter properties?), although the real no-changes case
|
|
|
|
// is extremely rare and might be impossible to produce organically. We
|
|
|
|
// should probably write some kind of "Nothing Happened!" change into the
|
|
|
|
// DB once we parse these changes so we can distinguish between
|
|
|
|
// "not parsed yet" and "no changes".
|
|
|
|
$no_changes->appendChild(
|
|
|
|
"This commit hasn't been fully parsed yet (or doesn't affect any ".
|
|
|
|
"paths).");
|
|
|
|
$content[] = $no_changes;
|
2011-03-27 08:52:09 +02:00
|
|
|
} else {
|
|
|
|
$change_panel = new AphrontPanelView();
|
2011-04-07 23:55:06 +02:00
|
|
|
$change_panel->setHeader("Changes (".number_format($count).")");
|
|
|
|
|
|
|
|
if ($count !== $original_changes_count) {
|
|
|
|
$show_all_button = phutil_render_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'class' => 'button green',
|
|
|
|
'href' => '?show_all=true',
|
|
|
|
),
|
|
|
|
phutil_escape_html('Show All Changes'));
|
|
|
|
$warning_view = id(new AphrontErrorView())
|
|
|
|
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
|
|
|
|
->setTitle(sprintf(
|
|
|
|
"Showing only the first %d changes out of %s!",
|
|
|
|
self::CHANGES_LIMIT,
|
|
|
|
number_format($original_changes_count)));
|
|
|
|
|
|
|
|
$change_panel->appendChild($warning_view);
|
|
|
|
$change_panel->addButton($show_all_button);
|
|
|
|
}
|
|
|
|
|
2011-03-27 08:52:09 +02:00
|
|
|
$change_panel->appendChild($change_table);
|
|
|
|
|
|
|
|
$content[] = $change_panel;
|
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$changesets = DiffusionPathChange::convertToDifferentialChangesets(
|
|
|
|
$changes);
|
|
|
|
|
|
|
|
$vcs = $repository->getVersionControlSystem();
|
|
|
|
switch ($vcs) {
|
|
|
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
|
|
|
$vcs_supports_directory_changes = true;
|
|
|
|
break;
|
|
|
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
Basic support for Mercurial in Diffusion
Summary: Change import script plus almost all the view stuff. Still some rough
edges but this seems to mostly work. Blame is currently unsupported but I think
everything else works properly.
Test Plan:
Imported the hg repository itself. It doesn't immediately seem completely
broken. Here are some screens:
https://secure.phabricator.com/file/view/PHID-FILE-1438b71cc7c4a2eb4569/
https://secure.phabricator.com/file/view/PHID-FILE-3cec4f72f39e7de2d041/
https://secure.phabricator.com/file/view/PHID-FILE-2ea4883f160e8e5098f9/
https://secure.phabricator.com/file/view/PHID-FILE-35f751a36ebf65399ade/
All the parsers were able to churn through it without errors.
Ran the new "reparse.php" script in various one-commit and repository modes.
Browsed/imported some git repos for good measure.
NOTE: The hg repository is only 15,000 commits and around 1,000 files.
Performance is okay but hg doesn't provide performant, native APIs to get some
data efficiently so we have to do some dumb stuff. If some of these interfaces
are cripplingly slow or whatever, let me know and we can start bundling some
Mercurial extensions with Arcanist.
Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran
Reviewed By: Makinde
CC: aran, Makinde, epriestley
Differential Revision: 960
2011-09-26 20:07:38 +02:00
|
|
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$vcs_supports_directory_changes = false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw new Exception("Unknown VCS.");
|
|
|
|
}
|
2011-03-31 07:08:41 +02:00
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$references = array();
|
|
|
|
foreach ($changesets as $key => $changeset) {
|
|
|
|
$file_type = $changeset->getFileType();
|
|
|
|
if ($file_type == DifferentialChangeType::FILE_DIRECTORY) {
|
|
|
|
if (!$vcs_supports_directory_changes) {
|
|
|
|
unset($changesets[$key]);
|
|
|
|
continue;
|
2011-03-31 07:08:41 +02:00
|
|
|
}
|
2011-03-31 04:22:11 +02:00
|
|
|
}
|
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$branch = $drequest->getBranchURIComponent(
|
|
|
|
$drequest->getBranch());
|
|
|
|
$filename = $changeset->getFilename();
|
2012-01-20 22:27:32 +01:00
|
|
|
$reference = "{$branch}{$filename};".$drequest->getCommit();
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$references[$key] = $reference;
|
2011-03-31 04:22:11 +02:00
|
|
|
}
|
2011-03-27 08:52:09 +02:00
|
|
|
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
$change_list = new DifferentialChangesetListView();
|
|
|
|
$change_list->setChangesets($changesets);
|
|
|
|
$change_list->setRenderingReferences($references);
|
|
|
|
$change_list->setRenderURI('/diffusion/'.$callsign.'/diff/');
|
2012-01-16 20:08:54 +01:00
|
|
|
$change_list->setUser($user);
|
Improve several Diffusion UI error states
Summary:
Give users better errors and UI:
- For subpath SVN repositories, default the path to the subdirectory, not to
"/". This makes the home screen useful and things generally less confusing.
- For unparsed commits, show a more descriptive error message without the
"blah blah" silliness.
- For paths outside of the subpath parse tree, short circuit into an
appropriate error message.
- For foreign SVN stub commits (see D892), show an explicit message.
Test Plan: Looked at unparsed commits, subpath repositories, foreign stub
commits, and paths outside of the subpath parse tree. Received sensible error
messages.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: jungejason
CC: aran, jungejason
Differential Revision: 894
2011-09-04 23:39:52 +02:00
|
|
|
|
|
|
|
// TODO: This is pretty awkward, unify the CSS between Diffusion and
|
|
|
|
// Differential better.
|
|
|
|
require_celerity_resource('differential-core-view-css');
|
|
|
|
$change_list =
|
|
|
|
'<div class="differential-primary-pane">'.
|
|
|
|
$change_list->render().
|
|
|
|
'</div>';
|
|
|
|
|
2011-03-27 08:52:09 +02:00
|
|
|
$content[] = $change_list;
|
|
|
|
}
|
2011-03-14 00:19:39 +01:00
|
|
|
|
2011-03-11 18:34:22 +01:00
|
|
|
return $this->buildStandardPageResponse(
|
2011-03-14 00:19:39 +01:00
|
|
|
$content,
|
2011-03-11 18:34:22 +01:00
|
|
|
array(
|
2012-01-20 22:27:32 +01:00
|
|
|
'title' => 'r'.$callsign.$commit->getCommitIdentifier(),
|
2011-03-11 18:34:22 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2011-04-02 02:11:05 +02:00
|
|
|
private function renderPropertyTable(
|
|
|
|
PhabricatorRepositoryCommit $commit,
|
|
|
|
PhabricatorRepositoryCommitData $data) {
|
|
|
|
|
|
|
|
$phids = array();
|
|
|
|
if ($data->getCommitDetail('authorPHID')) {
|
|
|
|
$phids[] = $data->getCommitDetail('authorPHID');
|
|
|
|
}
|
|
|
|
if ($data->getCommitDetail('reviewerPHID')) {
|
|
|
|
$phids[] = $data->getCommitDetail('reviewerPHID');
|
|
|
|
}
|
|
|
|
if ($data->getCommitDetail('differential.revisionPHID')) {
|
|
|
|
$phids[] = $data->getCommitDetail('differential.revisionPHID');
|
|
|
|
}
|
|
|
|
|
|
|
|
$handles = array();
|
|
|
|
if ($phids) {
|
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))
|
|
|
|
->loadHandles();
|
|
|
|
}
|
|
|
|
|
|
|
|
$props = array();
|
|
|
|
|
|
|
|
$author_phid = $data->getCommitDetail('authorPHID');
|
|
|
|
if ($data->getCommitDetail('authorPHID')) {
|
|
|
|
$props['Author'] = $handles[$author_phid]->renderLink();
|
|
|
|
} else {
|
|
|
|
$props['Author'] = phutil_escape_html($data->getAuthorName());
|
|
|
|
}
|
|
|
|
|
|
|
|
$reviewer_phid = $data->getCommitDetail('reviewerPHID');
|
|
|
|
$reviewer_name = $data->getCommitDetail('reviewerName');
|
|
|
|
if ($reviewer_phid) {
|
|
|
|
$props['Reviewer'] = $handles[$reviewer_phid]->renderLink();
|
|
|
|
} else if ($reviewer_name) {
|
|
|
|
$props['Reviewer'] = phutil_escape_html($reviewer_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
$revision_phid = $data->getCommitDetail('differential.revisionPHID');
|
|
|
|
if ($revision_phid) {
|
|
|
|
$props['Differential Revision'] = $handles[$revision_phid]->renderLink();
|
|
|
|
}
|
|
|
|
|
2012-01-19 20:49:51 +01:00
|
|
|
$request = $this->getDiffusionRequest();
|
|
|
|
|
|
|
|
$contains = DiffusionContainsQuery::newFromDiffusionRequest($request);
|
|
|
|
$branches = $contains->loadContainingBranches();
|
|
|
|
|
|
|
|
if ($branches) {
|
|
|
|
// TODO: Separate these into 'tracked' and other; link tracked branches.
|
|
|
|
$branches = implode(', ', array_keys($branches));
|
|
|
|
$branches = phutil_escape_html($branches);
|
|
|
|
$props['Branches'] = $branches;
|
|
|
|
}
|
|
|
|
|
2011-04-02 02:11:05 +02:00
|
|
|
$rows = array();
|
|
|
|
foreach ($props as $key => $value) {
|
|
|
|
$rows[] =
|
|
|
|
'<tr>'.
|
|
|
|
'<th>'.$key.':</th>'.
|
|
|
|
'<td>'.$value.'</td>'.
|
|
|
|
'</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
'<table class="diffusion-commit-properties">'.
|
|
|
|
implode("\n", $rows).
|
|
|
|
'</table>';
|
|
|
|
}
|
|
|
|
|
2012-02-24 22:02:14 +01:00
|
|
|
private function buildAuditTable($commit) {
|
|
|
|
$query = new PhabricatorAuditQuery();
|
|
|
|
$query->withCommitPHIDs(array($commit->getPHID()));
|
|
|
|
$audits = $query->execute();
|
|
|
|
|
|
|
|
$view = new PhabricatorAuditListView();
|
|
|
|
$view->setAudits($audits);
|
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
$panel->setHeader('Audits');
|
|
|
|
$panel->appendChild($view);
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
}
|
|
|
|
|
2011-03-11 18:34:22 +01:00
|
|
|
}
|