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

Add "r <name>" to jump nav to locate repositories by name

Summary: User request.

Test Plan: Searched for `r ph`, `r poetry`.

Reviewers: btrahan, bigo

Reviewed By: bigo

CC: aran

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

+41
+13
src/applications/repository/query/PhabricatorRepositoryQuery.php
··· 8 8 private $callsigns; 9 9 private $types; 10 10 private $uuids; 11 + private $nameContains; 11 12 12 13 const STATUS_OPEN = 'status-open'; 13 14 const STATUS_CLOSED = 'status-closed'; ··· 50 51 51 52 public function withUUIDs(array $uuids) { 52 53 $this->uuids = $uuids; 54 + return $this; 55 + } 56 + 57 + public function withNameContains($contains) { 58 + $this->nameContains = $contains; 53 59 return $this; 54 60 } 55 61 ··· 310 316 $conn_r, 311 317 'r.uuid IN (%Ls)', 312 318 $this->uuids); 319 + } 320 + 321 + if (strlen($this->nameContains)) { 322 + $where[] = qsprintf( 323 + $conn_r, 324 + 'name LIKE %~', 325 + $this->nameContains); 313 326 } 314 327 315 328 $where[] = $this->buildPagingClause($conn_r);
+12
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 10 10 $saved->setParameter('status', $request->getStr('status')); 11 11 $saved->setParameter('order', $request->getStr('order')); 12 12 $saved->setParameter('types', $request->getArr('types')); 13 + $saved->setParameter('name', $request->getStr('name')); 13 14 14 15 return $saved; 15 16 } ··· 43 44 $query->withTypes($types); 44 45 } 45 46 47 + $name = $saved->getParameter('name'); 48 + if (strlen($name)) { 49 + $query->withNameContains($name); 50 + } 51 + 46 52 return $query; 47 53 } 48 54 ··· 53 59 $callsigns = $saved_query->getParameter('callsigns', array()); 54 60 $types = $saved_query->getParameter('types', array()); 55 61 $types = array_fuse($types); 62 + $name = $saved_query->getParameter('name'); 56 63 57 64 $form 58 65 ->appendChild( ··· 60 67 ->setName('callsigns') 61 68 ->setLabel(pht('Callsigns')) 62 69 ->setValue(implode(', ', $callsigns))) 70 + ->appendChild( 71 + id(new AphrontFormTextControl()) 72 + ->setName('name') 73 + ->setLabel(pht('Name Contains')) 74 + ->setValue($name)) 63 75 ->appendChild( 64 76 id(new AphrontFormSelectControl()) 65 77 ->setName('status')
+15
src/applications/search/engine/PhabricatorJumpNavHandler.php
··· 21 21 '/^@(.+)$/i' => 'user', 22 22 '/^task:\s*(.+)/i' => 'create-task', 23 23 '/^(?:s|symbol)\s+(\S+)/i' => 'find-symbol', 24 + '/^r\s+(.+)$/i' => 'find-repository', 24 25 ); 25 26 26 27 foreach ($patterns as $pattern => $effect) { ··· 53 54 } 54 55 return id(new AphrontRedirectResponse()) 55 56 ->setURI("/diffusion/symbol/$symbol/?jump=true$context"); 57 + case 'find-repository': 58 + $name = $matches[1]; 59 + $repositories = id(new PhabricatorRepositoryQuery()) 60 + ->setViewer($viewer) 61 + ->withNameContains($name) 62 + ->execute(); 63 + if (count($repositories) == 1) { 64 + // Just one match, jump to repository. 65 + $uri = '/diffusion/'.head($repositories)->getCallsign().'/'; 66 + } else { 67 + // More than one match, jump to search. 68 + $uri = urisprintf('/diffusion/?order=name&name=%s', $name); 69 + } 70 + return id(new AphrontRedirectResponse())->setURI($uri); 56 71 case 'create-task': 57 72 return id(new AphrontRedirectResponse()) 58 73 ->setURI('/maniphest/task/create/?title='
+1
src/docs/user/userguide/jump.diviner
··· 18 18 - **r** - Jump to Diffusion. 19 19 - **rXYZ** - Jump to Diffusion Repository XYZ. 20 20 - **rXYZabcdef** - Jump to Diffusion Commit rXYZabcdef. 21 + - **r <name>** - Search for repositories by name. 21 22 - **u** - Jump to People 22 23 - **u username** - Jump to username's Profile 23 24 - **p** - Jump to Project