QueryScreen: Add support for Change-Id triplet in single query
When searching for changes with a Change-Id triplet that identifies a single unique change, for example: test-project~master~I869eb3c266c23de650c07fadeb4b861acc84c3c2 and changes exist on other projects or branches with the same Change-Id, then the search results in a list of all those changes, rather than going directly to the uniquely identified change. Add support for the Change-Id triplet in the single query check to avoid this. Change-Id: I2fdce6c790ee3c8d361320d4fa9009a9655d013f Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
This commit is contained in:
committed by
David Pursehouse
parent
696efd4933
commit
fd2d54b7bb
@@ -34,6 +34,8 @@ public class QueryScreen extends PagedSingleListScreen implements
|
||||
// Change-Id
|
||||
private static final String ID_PATTERN = "[iI][0-9a-f]{4,}$";
|
||||
private static final RegExp CHANGE_ID = RegExp.compile("^" + ID_PATTERN);
|
||||
private static final RegExp CHANGE_ID_TRIPLET =
|
||||
RegExp.compile("^(.)+~(.)+~" + ID_PATTERN);
|
||||
|
||||
public static QueryScreen forQuery(String query) {
|
||||
return forQuery(query, 0);
|
||||
@@ -92,6 +94,7 @@ public class QueryScreen extends PagedSingleListScreen implements
|
||||
private static boolean isSingleQuery(String query) {
|
||||
return NUMERIC_ID.test(query)
|
||||
|| CHANGE_ID.test(query)
|
||||
|| CHANGE_ID_TRIPLET.test(query)
|
||||
|| COMMIT_SHA1.test(query);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user