Differential D20544 Diff 49017 src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | $xactions = array( | ||||
| $this->newAuditTransactions($commit), | $this->newAuditTransactions($commit), | ||||
| $this->newPublishTransactions($commit), | $this->newPublishTransactions($commit), | ||||
| ); | ); | ||||
| $xactions = array_mergev($xactions); | $xactions = array_mergev($xactions); | ||||
| $acting_phid = $this->getPublishAsPHID($commit); | $acting_phid = $this->getPublishAsPHID($commit); | ||||
| $content_source = $this->newContentSource(); | $content_source = $this->newContentSource(); | ||||
| $revision = DiffusionCommitRevisionQuery::loadRevisionForCommit( | |||||
| $viewer, | |||||
| $commit); | |||||
| // Prevent the commit from generating a mention of the associated | |||||
| // revision, if one exists, so we don't double up because of the URI | |||||
| // in the commit message. | |||||
| $unmentionable_phids = array(); | |||||
| if ($revision) { | |||||
| $unmentionable_phids[] = $revision->getPHID(); | |||||
| } | |||||
| $editor = $commit->getApplicationTransactionEditor() | $editor = $commit->getApplicationTransactionEditor() | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setActingAsPHID($acting_phid) | ->setActingAsPHID($acting_phid) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
| ->setContentSource($content_source); | ->setContentSource($content_source) | ||||
| ->addUnmentionablePHIDs($unmentionable_phids); | |||||
| try { | try { | ||||
| $raw_patch = $this->loadRawPatchText($repository, $commit); | $raw_patch = $this->loadRawPatchText($repository, $commit); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $raw_patch = pht('Unable to generate patch: %s', $ex->getMessage()); | $raw_patch = pht('Unable to generate patch: %s', $ex->getMessage()); | ||||
| } | } | ||||
| $editor->setRawPatch($raw_patch); | $editor->setRawPatch($raw_patch); | ||||
| ▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines | |||||