Differential D20464 Diff 48838 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 156 Lines • ▼ Show 20 Lines | final protected function updateCommitData(DiffusionCommitRef $ref) { | ||||
$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. | ||||
$force_autoclose = idx($this->getTaskData(), 'forceAutoclose', false); | |||||
if ($force_autoclose) { | |||||
$autoclose_reason = PhabricatorRepository::BECAUSE_AUTOCLOSE_FORCED; | |||||
} else { | |||||
$autoclose_reason = $repository->shouldSkipAutocloseCommit($commit); | $autoclose_reason = $repository->shouldSkipAutocloseCommit($commit); | ||||
} | |||||
$data->setCommitDetail('autocloseReason', $autoclose_reason); | $data->setCommitDetail('autocloseReason', $autoclose_reason); | ||||
$should_autoclose = $force_autoclose || | $should_autoclose = $repository->shouldAutocloseCommit($commit); | ||||
$repository->shouldAutocloseCommit($commit); | |||||
// When updating related objects, we'll act under an omnipotent user to | |||||
// ensure we can see them, but take actions as either the committer or | |||||
// author (if we recognize their accounts) or the Diffusion application | |||||
// (if we do not). | |||||
epriestley: (This was really mooted by the last change; there's a longer explanatory comment in the new… | |||||
if ($should_autoclose) { | if ($should_autoclose) { | ||||
$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); | ||||
} | } | ||||
$data->save(); | $data->save(); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
(This was really mooted by the last change; there's a longer explanatory comment in the new worker now.)