Differential D19443 Diff 46541 src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | final protected function updateCommitData(DiffusionCommitRef $ref) { | ||||
$data->setAuthorName(id(new PhutilUTF8StringTruncator()) | $data->setAuthorName(id(new PhutilUTF8StringTruncator()) | ||||
->setMaximumBytes(255) | ->setMaximumBytes(255) | ||||
->truncateString((string)$author)); | ->truncateString((string)$author)); | ||||
$data->setCommitDetail('authorEpoch', $ref->getAuthorEpoch()); | $data->setCommitDetail('authorEpoch', $ref->getAuthorEpoch()); | ||||
$data->setCommitDetail('authorName', $ref->getAuthorName()); | $data->setCommitDetail('authorName', $ref->getAuthorName()); | ||||
$data->setCommitDetail('authorEmail', $ref->getAuthorEmail()); | $data->setCommitDetail('authorEmail', $ref->getAuthorEmail()); | ||||
$data->setCommitDetail( | $data->setCommitDetail( | ||||
amckinley: Not sure if we need to put this in the metadata too, but it seemed reasonable. | |||||
Done Inline ActionsI think it won't be necessary, since I believe we always have a Commit whenever we have CommitData. But it also can't really hurt anything. epriestley: I //think// it won't be necessary, since I believe we always have a `Commit` whenever we have… | |||||
'authorIdentityPHID', $author_identity->getPHID()); | |||||
$data->setCommitDetail( | |||||
'authorPHID', | 'authorPHID', | ||||
$this->resolveUserPHID($commit, $author)); | $this->resolveUserPHID($commit, $author)); | ||||
$data->setCommitMessage($message); | $data->setCommitMessage($message); | ||||
if (strlen($committer)) { | if (strlen($committer)) { | ||||
$data->setCommitDetail('committer', $committer); | $data->setCommitDetail('committer', $committer); | ||||
$data->setCommitDetail('committerName', $ref->getCommitterName()); | $data->setCommitDetail('committerName', $ref->getCommitterName()); | ||||
$data->setCommitDetail('committerEmail', $ref->getCommitterEmail()); | $data->setCommitDetail('committerEmail', $ref->getCommitterEmail()); | ||||
$data->setCommitDetail( | $data->setCommitDetail( | ||||
'committerPHID', | 'committerPHID', | ||||
$this->resolveUserPHID($commit, $committer)); | $this->resolveUserPHID($commit, $committer)); | ||||
$data->setCommitDetail( | |||||
'committerIdentityPHID', $committer_identity->getPHID()); | |||||
} | } | ||||
$repository = $this->repository; | $repository = $this->repository; | ||||
$author_phid = $data->getCommitDetail('authorPHID'); | $author_phid = $data->getCommitDetail('authorPHID'); | ||||
$committer_phid = $data->getCommitDetail('committerPHID'); | $committer_phid = $data->getCommitDetail('committerPHID'); | ||||
$user = new PhabricatorUser(); | $user = new PhabricatorUser(); | ||||
Show All 21 Lines | if (PhabricatorApplication::isClassInstalled($differential_app)) { | ||||
$data->setCommitDetail('differential.revisionID', $revision_id); | $data->setCommitDetail('differential.revisionID', $revision_id); | ||||
} | } | ||||
if ($author_phid != $commit->getAuthorPHID()) { | if ($author_phid != $commit->getAuthorPHID()) { | ||||
$commit->setAuthorPHID($author_phid); | $commit->setAuthorPHID($author_phid); | ||||
} | } | ||||
$commit->setAuthorIdentityPHID($author_identity->getPHID()); | |||||
$commit->setCommitterIdentityPHID($committer_identity->getPHID()); | |||||
$commit->setSummary($data->getSummary()); | $commit->setSummary($data->getSummary()); | ||||
$commit->save(); | $commit->save(); | ||||
// Figure out if we're going to try to "autoclose" related objects (e.g., | // Figure out if we're going to try to "autoclose" related objects (e.g., | ||||
// close linked tasks and related revisions) and, if not, record why we | // close linked tasks and related revisions) and, if not, record why we | ||||
// aren't. Autoclose can be disabled for various reasons at the repository | // aren't. Autoclose can be disabled for various reasons at the repository | ||||
// or commit levels. | // or commit levels. | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |
Not sure if we need to put this in the metadata too, but it seemed reasonable.