Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14036807
D7720.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D7720.diff
View Options
Index: src/applications/repository/query/PhabricatorRepositoryQuery.php
===================================================================
--- src/applications/repository/query/PhabricatorRepositoryQuery.php
+++ src/applications/repository/query/PhabricatorRepositoryQuery.php
@@ -8,6 +8,7 @@
private $callsigns;
private $types;
private $uuids;
+ private $nameContains;
const STATUS_OPEN = 'status-open';
const STATUS_CLOSED = 'status-closed';
@@ -53,6 +54,11 @@
return $this;
}
+ public function withNameContains($contains) {
+ $this->nameContains = $contains;
+ return $this;
+ }
+
public function needCommitCounts($need_counts) {
$this->needCommitCounts = $need_counts;
return $this;
@@ -312,6 +318,13 @@
$this->uuids);
}
+ if (strlen($this->nameContains)) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'name LIKE %~',
+ $this->nameContains);
+ }
+
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);
Index: src/applications/repository/query/PhabricatorRepositorySearchEngine.php
===================================================================
--- src/applications/repository/query/PhabricatorRepositorySearchEngine.php
+++ src/applications/repository/query/PhabricatorRepositorySearchEngine.php
@@ -10,6 +10,7 @@
$saved->setParameter('status', $request->getStr('status'));
$saved->setParameter('order', $request->getStr('order'));
$saved->setParameter('types', $request->getArr('types'));
+ $saved->setParameter('name', $request->getStr('name'));
return $saved;
}
@@ -43,6 +44,11 @@
$query->withTypes($types);
}
+ $name = $saved->getParameter('name');
+ if (strlen($name)) {
+ $query->withNameContains($name);
+ }
+
return $query;
}
@@ -53,6 +59,7 @@
$callsigns = $saved_query->getParameter('callsigns', array());
$types = $saved_query->getParameter('types', array());
$types = array_fuse($types);
+ $name = $saved_query->getParameter('name');
$form
->appendChild(
@@ -61,6 +68,11 @@
->setLabel(pht('Callsigns'))
->setValue(implode(', ', $callsigns)))
->appendChild(
+ id(new AphrontFormTextControl())
+ ->setName('name')
+ ->setLabel(pht('Name Contains'))
+ ->setValue($name))
+ ->appendChild(
id(new AphrontFormSelectControl())
->setName('status')
->setLabel(pht('Status'))
Index: src/applications/search/engine/PhabricatorJumpNavHandler.php
===================================================================
--- src/applications/search/engine/PhabricatorJumpNavHandler.php
+++ src/applications/search/engine/PhabricatorJumpNavHandler.php
@@ -21,6 +21,7 @@
'/^@(.+)$/i' => 'user',
'/^task:\s*(.+)/i' => 'create-task',
'/^(?:s|symbol)\s+(\S+)/i' => 'find-symbol',
+ '/^r\s+(.+)$/i' => 'find-repository',
);
foreach ($patterns as $pattern => $effect) {
@@ -53,6 +54,20 @@
}
return id(new AphrontRedirectResponse())
->setURI("/diffusion/symbol/$symbol/?jump=true$context");
+ case 'find-repository':
+ $name = $matches[1];
+ $repositories = id(new PhabricatorRepositoryQuery())
+ ->setViewer($viewer)
+ ->withNameContains($name)
+ ->execute();
+ if (count($repositories) == 1) {
+ // Just one match, jump to repository.
+ $uri = '/diffusion/'.head($repositories)->getCallsign().'/';
+ } else {
+ // More than one match, jump to search.
+ $uri = urisprintf('/diffusion/?order=name&name=%s', $name);
+ }
+ return id(new AphrontRedirectResponse())->setURI($uri);
case 'create-task':
return id(new AphrontRedirectResponse())
->setURI('/maniphest/task/create/?title='
Index: src/docs/user/userguide/jump.diviner
===================================================================
--- src/docs/user/userguide/jump.diviner
+++ src/docs/user/userguide/jump.diviner
@@ -18,6 +18,7 @@
- **r** - Jump to Diffusion.
- **rXYZ** - Jump to Diffusion Repository XYZ.
- **rXYZabcdef** - Jump to Diffusion Commit rXYZabcdef.
+ - **r <name>** - Search for repositories by name.
- **u** - Jump to People
- **u username** - Jump to username's Profile
- **p** - Jump to Project
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 11, 12:11 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734124
Default Alt Text
D7720.diff (4 KB)
Attached To
Mode
D7720: Add "r <name>" to jump nav to locate repositories by name
Attached
Detach File
Event Timeline
Log In to Comment