@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.

Allow revisions to be queried by repository

Summary: This isn't too useful most of the time since we don't automatically populate this data yet, but works fine.

Test Plan: See screenshot.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+34 -6
+13
src/applications/differential/query/DifferentialRevisionQuery.php
··· 39 39 private $branches = array(); 40 40 private $arcanistProjectPHIDs = array(); 41 41 private $draftRevisions = array(); 42 + private $repositoryPHIDs; 42 43 43 44 private $order = 'order-modified'; 44 45 const ORDER_MODIFIED = 'order-modified'; ··· 243 244 */ 244 245 public function withArcanistProjectPHIDs(array $arc_project_phids) { 245 246 $this->arcanistProjectPHIDs = $arc_project_phids; 247 + return $this; 248 + } 249 + 250 + public function withRepositoryPHIDs(array $repository_phids) { 251 + $this->repositoryPHIDs = $repository_phids; 246 252 return $this; 247 253 } 248 254 ··· 656 662 $conn_r, 657 663 'r.id IN (%Ld)', 658 664 $this->revIDs); 665 + } 666 + 667 + if ($this->repositoryPHIDs) { 668 + $where[] = qsprintf( 669 + $conn_r, 670 + 'r.repositoryPHID IN (%Ls)', 671 + $this->repositoryPHIDs); 659 672 } 660 673 661 674 if ($this->commitHashes) {
+21 -6
src/applications/differential/query/DifferentialRevisionSearchEngine.php
··· 30 30 $this->readUsersFromRequest($request, 'subscribers')); 31 31 32 32 $saved->setParameter( 33 + 'repositoryPHIDs', 34 + $request->getArr('repositories')); 35 + 36 + $saved->setParameter( 33 37 'draft', 34 38 $request->getBool('draft')); 35 39 ··· 68 72 $query->withCCs($subscriber_phids); 69 73 } 70 74 75 + $repository_phids = $saved->getParameter('repositoryPHIDs', array()); 76 + if ($repository_phids) { 77 + $query->withRepositoryPHIDs($repository_phids); 78 + } 79 + 71 80 $draft = $saved->getParameter('draft', false); 72 81 if ($draft && $this->requireViewer()->isLoggedIn()) { 73 82 $query->withDraftRepliesByAuthors( ··· 97 106 $author_phids = $saved->getParameter('authorPHIDs', array()); 98 107 $reviewer_phids = $saved->getParameter('reviewerPHIDs', array()); 99 108 $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); 109 + $repository_phids = $saved->getParameter('repositoryPHIDs', array()); 100 110 $only_draft = $saved->getParameter('draft', false); 101 111 102 112 $all_phids = array_mergev( ··· 105 115 $author_phids, 106 116 $reviewer_phids, 107 117 $subscriber_phids, 118 + $repository_phids, 108 119 )); 109 120 110 121 $handles = id(new PhabricatorHandleQuery()) ··· 112 123 ->withPHIDs($all_phids) 113 124 ->execute(); 114 125 115 - $tokens = mpull($handles, 'getFullName', 'getPHID'); 116 - 117 126 $form 118 127 ->appendChild( 119 128 id(new AphrontFormTokenizerControl()) 120 129 ->setLabel(pht('Responsible Users')) 121 130 ->setName('responsibles') 122 131 ->setDatasource('/typeahead/common/accounts/') 123 - ->setValue(array_select_keys($tokens, $responsible_phids))) 132 + ->setValue(array_select_keys($handles, $responsible_phids))) 124 133 ->appendChild( 125 134 id(new AphrontFormTokenizerControl()) 126 135 ->setLabel(pht('Authors')) 127 136 ->setName('authors') 128 137 ->setDatasource('/typeahead/common/accounts/') 129 - ->setValue(array_select_keys($tokens, $author_phids))) 138 + ->setValue(array_select_keys($handles, $author_phids))) 130 139 ->appendChild( 131 140 id(new AphrontFormTokenizerControl()) 132 141 ->setLabel(pht('Reviewers')) 133 142 ->setName('reviewers') 134 143 ->setDatasource('/typeahead/common/accounts/') 135 - ->setValue(array_select_keys($tokens, $reviewer_phids))) 144 + ->setValue(array_select_keys($handles, $reviewer_phids))) 136 145 ->appendChild( 137 146 id(new AphrontFormTokenizerControl()) 138 147 ->setLabel(pht('Subscribers')) 139 148 ->setName('subscribers') 140 149 ->setDatasource('/typeahead/common/allmailable/') 141 - ->setValue(array_select_keys($tokens, $subscriber_phids))) 150 + ->setValue(array_select_keys($handles, $subscriber_phids))) 151 + ->appendChild( 152 + id(new AphrontFormTokenizerControl()) 153 + ->setLabel(pht('Repositories')) 154 + ->setName('repositories') 155 + ->setDatasource('/typeahead/common/repositories/') 156 + ->setValue(array_select_keys($handles, $repository_phids))) 142 157 ->appendChild( 143 158 id(new AphrontFormSelectControl()) 144 159 ->setLabel(pht('Status'))