1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Revive essential commit details

Summary: Deleted by D3977.

Test Plan:
  ./reparse.php --message

Reviewers: epriestley, edward

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4090
This commit is contained in:
vrana 2012-12-05 23:08:43 -08:00
parent 86470e7a30
commit cb45ad67a3
2 changed files with 33 additions and 19 deletions

View file

@ -370,11 +370,8 @@ final class DiffusionCommitController extends DiffusionController {
}
$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);
}
$committer = $data->getCommitDetail('committer');

View file

@ -34,6 +34,34 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$data->getCommitDetail('authorPHID'));
$data->setCommitDetail('authorPHID', $author_phid);
$user = new PhabricatorUser();
if ($author_phid) {
$user = $user->loadOneWhere(
'phid = %s',
$author_phid);
}
$call = new ConduitCall(
'differential.parsecommitmessage',
array(
'corpus' => $message,
'partial' => true,
));
$call->setUser($user);
$result = $call->execute();
$field_values = $result['fields'];
if (!empty($field_values['reviewedByPHIDs'])) {
$data->setCommitDetail(
'reviewerPHID',
reset($field_values['reviewedByPHIDs']));
}
$data->setCommitDetail(
'differential.revisionID',
idx($field_values, 'revisionID'));
$committer_phid = $this->lookupUser(
$commit,
$data->getCommitDetail('committer'),
@ -81,6 +109,10 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$revision = id(new DifferentialRevision())->load($revision_id);
if ($revision) {
$data->setCommitDetail(
'differential.revisionPHID',
$revision->getPHID());
$revision->loadRelationships();
queryfx(
$conn_w,
@ -150,22 +182,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$lock->unlock();
}
if ($should_autoclose && $author_phid) {
$user = id(new PhabricatorUser())->loadOneWhere(
'phid = %s',
$author_phid);
$call = new ConduitCall(
'differential.parsecommitmessage',
array(
'corpus' => $message,
'partial' => true,
));
$call->setUser($user);
$result = $call->execute();
$field_values = $result['fields'];
if ($should_autoclose) {
$fields = DifferentialFieldSelector::newSelector()
->getFieldSpecifications();
foreach ($fields as $key => $field) {