Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
Show First 20 Lines • Show All 1,052 Lines • ▼ Show 20 Lines | |||||
/* -( Internals )---------------------------------------------------------- */ | /* -( Internals )---------------------------------------------------------- */ | ||||
private function newPushLog() { | private function newPushLog() { | ||||
// NOTE: We generate PHIDs up front so the Herald transcripts can pick them | // NOTE: We generate PHIDs up front so the Herald transcripts can pick them | ||||
// up. | // up. | ||||
$phid = id(new PhabricatorRepositoryPushLog())->generatePHID(); | $phid = id(new PhabricatorRepositoryPushLog())->generatePHID(); | ||||
$device = AlmanacKeys::getLiveDevice(); | |||||
if ($device) { | |||||
$device_phid = $device->getPHID(); | |||||
} else { | |||||
$device_phid = null; | |||||
} | |||||
return PhabricatorRepositoryPushLog::initializeNewLog($this->getViewer()) | return PhabricatorRepositoryPushLog::initializeNewLog($this->getViewer()) | ||||
->setPHID($phid) | ->setPHID($phid) | ||||
->setDevicePHID($device_phid) | |||||
->setRepositoryPHID($this->getRepository()->getPHID()) | ->setRepositoryPHID($this->getRepository()->getPHID()) | ||||
->attachRepository($this->getRepository()) | ->attachRepository($this->getRepository()) | ||||
->setEpoch(time()); | ->setEpoch(time()); | ||||
} | } | ||||
private function newPushEvent() { | private function newPushEvent() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
return PhabricatorRepositoryPushEvent::initializeNewEvent($viewer) | return PhabricatorRepositoryPushEvent::initializeNewEvent($viewer) | ||||
▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines |