@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Expose repository info in arcanist.projectinfo

Summary: This is to reduce number of calls from Arcanist.

Test Plan: Called it from web interface.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4146

vrana 0e53731d 6ed02e6e

+17 -14
+3
src/applications/conduit/method/arcanist/ConduitAPI_arcanist_projectinfo_Method.php
··· 42 42 $repository_phid = null; 43 43 $tracked = false; 44 44 $encoding = null; 45 + $dictionary = array(); 45 46 if ($repository) { 46 47 $repository_phid = $repository->getPHID(); 47 48 $tracked = $repository->isTracked(); 48 49 $encoding = $repository->getDetail('encoding'); 50 + $dictionary = $repository->toDictionary(); 49 51 } 50 52 51 53 return array( ··· 54 56 'repositoryPHID' => $repository_phid, 55 57 'tracked' => $tracked, 56 58 'encoding' => $encoding, 59 + 'repository' => $dictionary, 57 60 ); 58 61 } 59 62
-13
src/applications/conduit/method/repository/ConduitAPI_repository_Method.php
··· 5 5 */ 6 6 abstract class ConduitAPI_repository_Method extends ConduitAPIMethod { 7 7 8 - protected function buildDictForRepository(PhabricatorRepository $repository) { 9 - return array( 10 - 'name' => $repository->getName(), 11 - 'phid' => $repository->getPHID(), 12 - 'callsign' => $repository->getCallsign(), 13 - 'vcs' => $repository->getVersionControlSystem(), 14 - 'uri' => PhabricatorEnv::getProductionURI($repository->getURI()), 15 - 'remoteURI' => (string)$repository->getPublicRemoteURI(), 16 - 'tracking' => $repository->getDetail('tracking-enabled'), 17 - 'description' => $repository->getDetail('description'), 18 - ); 19 - } 20 - 21 8 }
+1 -1
src/applications/conduit/method/repository/ConduitAPI_repository_query_Method.php
··· 37 37 38 38 $results = array(); 39 39 foreach ($repositories as $repository) { 40 - $results[] = $this->buildDictForRepository($repository); 40 + $results[] = $repository->toDictionary(); 41 41 } 42 42 43 43 return $results;
+13
src/applications/repository/storage/PhabricatorRepository.php
··· 36 36 PhabricatorPHIDConstants::PHID_TYPE_REPO); 37 37 } 38 38 39 + public function toDictionary() { 40 + return array( 41 + 'name' => $this->getName(), 42 + 'phid' => $this->getPHID(), 43 + 'callsign' => $this->getCallsign(), 44 + 'vcs' => $this->getVersionControlSystem(), 45 + 'uri' => PhabricatorEnv::getProductionURI($this->getURI()), 46 + 'remoteURI' => (string)$this->getPublicRemoteURI(), 47 + 'tracking' => $this->getDetail('tracking-enabled'), 48 + 'description' => $this->getDetail('description'), 49 + ); 50 + } 51 + 39 52 public function getDetail($key, $default = null) { 40 53 return idx($this->details, $key, $default); 41 54 }