1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Expose "identifiers" as a query constraint for Commit search

Summary: Ref T13216. See PHI984. The CommitSearchEngine (and, by extension, `diffusion.commit.search`) currently do not support identifier search, but this is a reasonable capability to provide.

Test Plan:
Testing that a commit exists on `master`:

{F6020742}

Same commit is not on `stable`:

{F6020743}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

Differential Revision: https://secure.phabricator.com/D19825
This commit is contained in:
epriestley 2018-11-21 08:46:48 -08:00
parent 43cf4edfb1
commit 45e93c8f1d

View file

@ -58,6 +58,10 @@ final class PhabricatorCommitSearchEngine
$query->withAncestorsOf($map['ancestorsOf']);
}
if ($map['identifiers']) {
$query->withIdentifiers($map['identifiers']);
}
return $query;
}
@ -130,6 +134,15 @@ final class PhabricatorCommitSearchEngine
pht(
'Find commits which are ancestors of a particular ref, '.
'like "master".')),
id(new PhabricatorSearchStringListField())
->setLabel(pht('Identifiers'))
->setKey('identifiers')
->setDescription(
pht(
'Find commits with particular identifiers (usually, hashes). '.
'Supports full or partial identifiers (like "abcd12340987..." or '.
'"abcd1234") and qualified or unqualified identifiers (like '.
'"rXabcd1234" or "abcd1234").')),
);
}