From 6855018bb3a81b7de91a7b58560885fdc9684516 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Sat, 9 Aug 2014 03:32:08 +0200 Subject: [PATCH] SSH query command: Add --start n option to skip n changes Change-Id: If5031ce1a91a4fa68828241f1dfcf0c54f58652e --- Documentation/cmd-query.txt | 5 +++++ .../google/gerrit/server/query/change/QueryProcessor.java | 2 +- .../src/main/java/com/google/gerrit/sshd/commands/Query.java | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Documentation/cmd-query.txt b/Documentation/cmd-query.txt index 7577e03fe6..0a04441204 100644 --- a/Documentation/cmd-query.txt +++ b/Documentation/cmd-query.txt @@ -15,6 +15,7 @@ gerrit query - Query the change database [--dependencies] [--submit-records] [--all-reviewers] + [--start | -S ] [--] [limit:] @@ -95,6 +96,10 @@ command line parser in the server). includes whether the change meets the criteria for submission (including information for each review label). +--start:: +-S:: + Number of changes to skip. + limit::: Maximum number of results to return. This is actually a query operator, and not a command line option. If more diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryProcessor.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryProcessor.java index 3320886342..58e5f85233 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryProcessor.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryProcessor.java @@ -146,7 +146,7 @@ public class QueryProcessor { limit = n; } - void setStart(int n) { + public void setStart(int n) { start = n; } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java index 2bda15d325..a6a6932df7 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/Query.java @@ -85,6 +85,11 @@ class Query extends SshCommand { processor.setIncludeSubmitRecords(on); } + @Option(name = "--start", aliases = {"-S"}, usage = "Number of changes to skip") + void setStart(int start) { + processor.setStart(start); + } + @Argument(index = 0, required = true, multiValued = true, metaVar = "QUERY", usage = "Query to execute") private List query;