Differential D20465 Diff 48839 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 151 Lines • ▼ Show 20 Lines | if ($author_phid != $commit->getAuthorPHID()) { | ||||
| $commit->setAuthorPHID($author_phid); | $commit->setAuthorPHID($author_phid); | ||||
| } | } | ||||
| $commit->setAuthorIdentityPHID($author_identity->getPHID()); | $commit->setAuthorIdentityPHID($author_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., | // If we're publishing this commit, we're going to queue tasks to update | ||||
| // close linked tasks and related revisions) and, if not, record why we | // referenced objects (like tasks and revisions). Otherwise, record some | ||||
| // aren't. Autoclose can be disabled for various reasons at the repository | // details about why we are not publishing it yet. | ||||
| // or commit levels. | |||||
| $autoclose_reason = $repository->shouldSkipAutocloseCommit($commit); | |||||
| $data->setCommitDetail('autocloseReason', $autoclose_reason); | |||||
| $should_autoclose = $repository->shouldAutocloseCommit($commit); | |||||
| if ($should_autoclose) { | $publisher = $repository->newPublisher(); | ||||
| if ($publisher->shouldPublishCommit($commit)) { | |||||
| $actor = PhabricatorUser::getOmnipotentUser(); | $actor = PhabricatorUser::getOmnipotentUser(); | ||||
| $this->closeRevisions($actor, $ref, $commit, $data); | $this->closeRevisions($actor, $ref, $commit, $data); | ||||
| $this->closeTasks($actor, $ref, $commit, $data); | $this->closeTasks($actor, $ref, $commit, $data); | ||||
| } else { | |||||
| $hold_reasons = $publisher->getCommitHoldReasons($commit); | |||||
| $data->setCommitDetail('holdReasons', $hold_reasons); | |||||
| } | } | ||||
| $data->save(); | $data->save(); | ||||
| $commit->writeImportStatusFlag( | $commit->writeImportStatusFlag( | ||||
| PhabricatorRepositoryCommit::IMPORTED_MESSAGE); | PhabricatorRepositoryCommit::IMPORTED_MESSAGE); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines | |||||