Reformat all Java files with google-java-format 1.6
Reformat all files with the exception of: - lib/asciidoctor/java/AsciiDoctor.java to avoid requiring the Library-Compliance label. Change-Id: Iedba3f24ac00e2186e3e0688fabea817ddf43739
This commit is contained in:
parent
cc21a0a470
commit
54c04f59b9
@ -47,9 +47,8 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "section.name",
|
name = "section.name",
|
||||||
values = {"value-1", "value-2"}
|
values = {"value-1", "value-2"})
|
||||||
)
|
|
||||||
public void testList() {
|
public void testList() {
|
||||||
assertThat(cfg.getStringList("section", null, "name"))
|
assertThat(cfg.getStringList("section", null, "name"))
|
||||||
.asList()
|
.asList()
|
||||||
@ -58,9 +57,8 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "section.subsection.name",
|
name = "section.subsection.name",
|
||||||
values = {"value-1", "value-2"}
|
values = {"value-1", "value-2"})
|
||||||
)
|
|
||||||
public void testListWithSubsection() {
|
public void testListWithSubsection() {
|
||||||
assertThat(cfg.getStringList("section", "subsection", "name"))
|
assertThat(cfg.getStringList("section", "subsection", "name"))
|
||||||
.asList()
|
.asList()
|
||||||
@ -69,10 +67,9 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "section.name",
|
name = "section.name",
|
||||||
value = "value-1",
|
value = "value-1",
|
||||||
values = {"value-2", "value-3"}
|
values = {"value-2", "value-3"})
|
||||||
)
|
|
||||||
public void valueHasPrecedenceOverValues() {
|
public void valueHasPrecedenceOverValues() {
|
||||||
assertThat(cfg.getStringList("section", null, "name")).asList().containsExactly("value-1");
|
assertThat(cfg.getStringList("section", null, "name")).asList().containsExactly("value-1");
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,9 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
@Test
|
@Test
|
||||||
@UseLocalDisk
|
@UseLocalDisk
|
||||||
@GlobalPluginConfig(
|
@GlobalPluginConfig(
|
||||||
pluginName = "test",
|
pluginName = "test",
|
||||||
name = "section.name",
|
name = "section.name",
|
||||||
values = {"value-1", "value-2"}
|
values = {"value-1", "value-2"})
|
||||||
)
|
|
||||||
public void testList() {
|
public void testList() {
|
||||||
assertThat(cfg().getStringList("section", null, "name"))
|
assertThat(cfg().getStringList("section", null, "name"))
|
||||||
.asList()
|
.asList()
|
||||||
@ -70,10 +69,9 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
@Test
|
@Test
|
||||||
@UseLocalDisk
|
@UseLocalDisk
|
||||||
@GlobalPluginConfig(
|
@GlobalPluginConfig(
|
||||||
pluginName = "test",
|
pluginName = "test",
|
||||||
name = "section.subsection.name",
|
name = "section.subsection.name",
|
||||||
values = {"value-1", "value-2"}
|
values = {"value-1", "value-2"})
|
||||||
)
|
|
||||||
public void testListWithSubsection() {
|
public void testListWithSubsection() {
|
||||||
assertThat(cfg().getStringList("section", "subsection", "name"))
|
assertThat(cfg().getStringList("section", "subsection", "name"))
|
||||||
.asList()
|
.asList()
|
||||||
@ -83,11 +81,10 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
|
|||||||
@Test
|
@Test
|
||||||
@UseLocalDisk
|
@UseLocalDisk
|
||||||
@GlobalPluginConfig(
|
@GlobalPluginConfig(
|
||||||
pluginName = "test",
|
pluginName = "test",
|
||||||
name = "section.name",
|
name = "section.name",
|
||||||
value = "value-1",
|
value = "value-1",
|
||||||
values = {"value-2", "value-3"}
|
values = {"value-2", "value-3"})
|
||||||
)
|
|
||||||
public void valueHasPrecedenceOverValues() {
|
public void valueHasPrecedenceOverValues() {
|
||||||
assertThat(cfg().getStringList("section", null, "name")).asList().containsExactly("value-1");
|
assertThat(cfg().getStringList("section", null, "name")).asList().containsExactly("value-1");
|
||||||
}
|
}
|
||||||
|
@ -647,9 +647,8 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "auth.registerEmailPrivateKey",
|
name = "auth.registerEmailPrivateKey",
|
||||||
value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co="
|
value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co=")
|
||||||
)
|
|
||||||
public void addEmailSendsConfirmationEmail() throws Exception {
|
public void addEmailSendsConfirmationEmail() throws Exception {
|
||||||
String email = "new.email@example.com";
|
String email = "new.email@example.com";
|
||||||
EmailInput input = newEmailInput(email, false);
|
EmailInput input = newEmailInput(email, false);
|
||||||
|
@ -62,9 +62,8 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
// download
|
// download
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "download.archive",
|
name = "download.archive",
|
||||||
values = {"tar", "tbz2", "tgz", "txz"}
|
values = {"tar", "tbz2", "tgz", "txz"})
|
||||||
)
|
|
||||||
|
|
||||||
// gerrit
|
// gerrit
|
||||||
@GerritConfig(name = "gerrit.allProjects", value = "Root")
|
@GerritConfig(name = "gerrit.allProjects", value = "Root")
|
||||||
|
@ -47,9 +47,8 @@ public class ListMailFilterIT extends AbstractMailIT {
|
|||||||
@Test
|
@Test
|
||||||
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
|
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "receiveemail.filter.patterns",
|
name = "receiveemail.filter.patterns",
|
||||||
values = {".+ser@example\\.com", "a@b\\.com"}
|
values = {".+ser@example\\.com", "a@b\\.com"})
|
||||||
)
|
|
||||||
public void listFilterWhitelistDoesNotFilterListedUser() throws Exception {
|
public void listFilterWhitelistDoesNotFilterListedUser() throws Exception {
|
||||||
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
||||||
// Check that the comments from the email have been persisted
|
// Check that the comments from the email have been persisted
|
||||||
@ -60,9 +59,8 @@ public class ListMailFilterIT extends AbstractMailIT {
|
|||||||
@Test
|
@Test
|
||||||
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
|
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "receiveemail.filter.patterns",
|
name = "receiveemail.filter.patterns",
|
||||||
values = {".+@gerritcodereview\\.com", "a@b\\.com"}
|
values = {".+@gerritcodereview\\.com", "a@b\\.com"})
|
||||||
)
|
|
||||||
public void listFilterWhitelistFiltersNotListedUser() throws Exception {
|
public void listFilterWhitelistFiltersNotListedUser() throws Exception {
|
||||||
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
||||||
// Check that the comments from the email have NOT been persisted
|
// Check that the comments from the email have NOT been persisted
|
||||||
@ -73,9 +71,8 @@ public class ListMailFilterIT extends AbstractMailIT {
|
|||||||
@Test
|
@Test
|
||||||
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
|
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "receiveemail.filter.patterns",
|
name = "receiveemail.filter.patterns",
|
||||||
values = {".+@gerritcodereview\\.com", "a@b\\.com"}
|
values = {".+@gerritcodereview\\.com", "a@b\\.com"})
|
||||||
)
|
|
||||||
public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception {
|
public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception {
|
||||||
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
||||||
// Check that the comments from the email have been persisted
|
// Check that the comments from the email have been persisted
|
||||||
@ -86,9 +83,8 @@ public class ListMailFilterIT extends AbstractMailIT {
|
|||||||
@Test
|
@Test
|
||||||
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
|
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "receiveemail.filter.patterns",
|
name = "receiveemail.filter.patterns",
|
||||||
values = {".+@example\\.com", "a@b\\.com"}
|
values = {".+@example\\.com", "a@b\\.com"})
|
||||||
)
|
|
||||||
public void listFilterBlacklistFiltersListedUser() throws Exception {
|
public void listFilterBlacklistFiltersListedUser() throws Exception {
|
||||||
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
ChangeInfo changeInfo = createChangeAndReplyByEmail();
|
||||||
// Check that the comments from the email have been persisted
|
// Check that the comments from the email have been persisted
|
||||||
|
@ -56,9 +56,8 @@ public class UploadArchiveIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@GerritConfig(
|
@GerritConfig(
|
||||||
name = "download.archive",
|
name = "download.archive",
|
||||||
values = {"tar", "tbz2", "tgz", "txz"}
|
values = {"tar", "tbz2", "tgz", "txz"})
|
||||||
)
|
|
||||||
public void zipFormatDisabled() throws Exception {
|
public void zipFormatDisabled() throws Exception {
|
||||||
archiveNotPermitted();
|
archiveNotPermitted();
|
||||||
}
|
}
|
||||||
|
@ -162,20 +162,18 @@ public class Daemon extends SiteProgram {
|
|||||||
private boolean polyGerritDev;
|
private boolean polyGerritDev;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--init",
|
name = "--init",
|
||||||
aliases = {"-i"},
|
aliases = {"-i"},
|
||||||
usage = "Init site before starting the daemon"
|
usage = "Init site before starting the daemon")
|
||||||
)
|
|
||||||
private boolean doInit;
|
private boolean doInit;
|
||||||
|
|
||||||
@Option(name = "--stop-only", usage = "Stop the daemon", hidden = true)
|
@Option(name = "--stop-only", usage = "Stop the daemon", hidden = true)
|
||||||
private boolean stopOnly;
|
private boolean stopOnly;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--migrate-to-note-db",
|
name = "--migrate-to-note-db",
|
||||||
usage = "Automatically migrate changes to NoteDb",
|
usage = "Automatically migrate changes to NoteDb",
|
||||||
handler = ExplicitBooleanOptionHandler.class
|
handler = ExplicitBooleanOptionHandler.class)
|
||||||
)
|
|
||||||
private boolean migrateToNoteDb;
|
private boolean migrateToNoteDb;
|
||||||
|
|
||||||
@Option(name = "--trial", usage = "(With --migrate-to-note-db) " + MigrateToNoteDb.TRIAL_USAGE)
|
@Option(name = "--trial", usage = "(With --migrate-to-note-db) " + MigrateToNoteDb.TRIAL_USAGE)
|
||||||
|
@ -44,10 +44,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Initialize a new Gerrit installation. */
|
/** Initialize a new Gerrit installation. */
|
||||||
public class Init extends BaseInit {
|
public class Init extends BaseInit {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--batch",
|
name = "--batch",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
usage = "Batch mode; skip interactive prompting"
|
usage = "Batch mode; skip interactive prompting")
|
||||||
)
|
|
||||||
private boolean batchMode;
|
private boolean batchMode;
|
||||||
|
|
||||||
@Option(name = "--delete-caches", usage = "Delete all persistent caches without asking")
|
@Option(name = "--delete-caches", usage = "Delete all persistent caches without asking")
|
||||||
@ -69,9 +68,8 @@ public class Init extends BaseInit {
|
|||||||
private boolean installAllPlugins;
|
private boolean installAllPlugins;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--secure-store-lib",
|
name = "--secure-store-lib",
|
||||||
usage = "Path to jar providing SecureStore implementation class"
|
usage = "Path to jar providing SecureStore implementation class")
|
||||||
)
|
|
||||||
private String secureStoreLib;
|
private String secureStoreLib;
|
||||||
|
|
||||||
@Option(name = "--dev", usage = "Setup site with default options suitable for developers")
|
@Option(name = "--dev", usage = "Setup site with default options suitable for developers")
|
||||||
|
@ -43,9 +43,8 @@ public class MigrateAccountPatchReviewDb extends SiteProgram {
|
|||||||
private String sourceUrl;
|
private String sourceUrl;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--chunkSize",
|
name = "--chunkSize",
|
||||||
usage = "chunk size of fetching from source and push to target on each time"
|
usage = "chunk size of fetching from source and push to target on each time")
|
||||||
)
|
|
||||||
private static long chunkSize = 100000;
|
private static long chunkSize = 100000;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,46 +55,42 @@ public class MigrateToNoteDb extends SiteProgram {
|
|||||||
private Integer threads;
|
private Integer threads;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project",
|
name = "--project",
|
||||||
usage =
|
usage =
|
||||||
"Only rebuild these projects, do no other migration; incompatible with --change;"
|
"Only rebuild these projects, do no other migration; incompatible with --change;"
|
||||||
+ " recommended for debugging only"
|
+ " recommended for debugging only")
|
||||||
)
|
|
||||||
private List<String> projects = new ArrayList<>();
|
private List<String> projects = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--change",
|
name = "--change",
|
||||||
usage =
|
usage =
|
||||||
"Only rebuild these changes, do no other migration; incompatible with --project;"
|
"Only rebuild these changes, do no other migration; incompatible with --project;"
|
||||||
+ " recommended for debugging only"
|
+ " recommended for debugging only")
|
||||||
)
|
|
||||||
private List<Integer> changes = new ArrayList<>();
|
private List<Integer> changes = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--force",
|
name = "--force",
|
||||||
usage =
|
usage =
|
||||||
"Force rebuilding changes where ReviewDb is still the source of truth, even if they"
|
"Force rebuilding changes where ReviewDb is still the source of truth, even if they"
|
||||||
+ " were previously migrated"
|
+ " were previously migrated")
|
||||||
)
|
|
||||||
private boolean force;
|
private boolean force;
|
||||||
|
|
||||||
@Option(name = "--trial", usage = TRIAL_USAGE)
|
@Option(name = "--trial", usage = TRIAL_USAGE)
|
||||||
private boolean trial;
|
private boolean trial;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--sequence-gap",
|
name = "--sequence-gap",
|
||||||
usage =
|
usage =
|
||||||
"gap in change sequence numbers between last ReviewDb number and first NoteDb number;"
|
"gap in change sequence numbers between last ReviewDb number and first NoteDb number;"
|
||||||
+ " negative indicates using the value of noteDb.changes.initialSequenceGap (default"
|
+ " negative indicates using the value of noteDb.changes.initialSequenceGap (default"
|
||||||
+ " 1000)"
|
+ " 1000)")
|
||||||
)
|
|
||||||
private int sequenceGap;
|
private int sequenceGap;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--reindex",
|
name = "--reindex",
|
||||||
usage = "Reindex all changes after migration; defaults to false in trial mode, true otherwise",
|
usage =
|
||||||
handler = ExplicitBooleanOptionHandler.class
|
"Reindex all changes after migration; defaults to false in trial mode, true otherwise",
|
||||||
)
|
handler = ExplicitBooleanOptionHandler.class)
|
||||||
private Boolean reindex;
|
private Boolean reindex;
|
||||||
|
|
||||||
private Injector dbInjector;
|
private Injector dbInjector;
|
||||||
|
@ -38,11 +38,10 @@ public class Passwd extends SiteProgram {
|
|||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
metaVar = "SECTION.KEY",
|
metaVar = "SECTION.KEY",
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
usage = "Section and key separated by a dot of the password to set"
|
usage = "Section and key separated by a dot of the password to set")
|
||||||
)
|
|
||||||
private String sectionAndKey;
|
private String sectionAndKey;
|
||||||
|
|
||||||
@Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set")
|
@Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set")
|
||||||
|
@ -32,12 +32,11 @@ import org.kohsuke.args4j.Option;
|
|||||||
|
|
||||||
public class ProtoGen extends AbstractProgram {
|
public class ProtoGen extends AbstractProgram {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--output",
|
name = "--output",
|
||||||
aliases = {"-o"},
|
aliases = {"-o"},
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "FILE",
|
metaVar = "FILE",
|
||||||
usage = "File to write .proto into"
|
usage = "File to write .proto into")
|
||||||
)
|
|
||||||
private File file;
|
private File file;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -65,12 +65,11 @@ import org.kohsuke.args4j.Option;
|
|||||||
*/
|
*/
|
||||||
public class ProtobufImport extends SiteProgram {
|
public class ProtobufImport extends SiteProgram {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--file",
|
name = "--file",
|
||||||
aliases = {"-f"},
|
aliases = {"-f"},
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "FILE",
|
metaVar = "FILE",
|
||||||
usage = "File to import from"
|
usage = "File to import from")
|
||||||
)
|
|
||||||
private File file;
|
private File file;
|
||||||
|
|
||||||
private final LifecycleManager manager = new LifecycleManager();
|
private final LifecycleManager manager = new LifecycleManager();
|
||||||
|
@ -57,9 +57,8 @@ public class Reindex extends SiteProgram {
|
|||||||
private int threads = Runtime.getRuntime().availableProcessors();
|
private int threads = Runtime.getRuntime().availableProcessors();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--changes-schema-version",
|
name = "--changes-schema-version",
|
||||||
usage = "Schema version to reindex, for changes; default is most recent version"
|
usage = "Schema version to reindex, for changes; default is most recent version")
|
||||||
)
|
|
||||||
private Integer changesVersion;
|
private Integer changesVersion;
|
||||||
|
|
||||||
@Option(name = "--verbose", usage = "Output debug information for each change")
|
@Option(name = "--verbose", usage = "Output debug information for each change")
|
||||||
|
@ -44,11 +44,10 @@ public class Rulec extends SiteProgram {
|
|||||||
private boolean quiet;
|
private boolean quiet;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "PROJECT",
|
metaVar = "PROJECT",
|
||||||
usage = "project to compile rules for"
|
usage = "project to compile rules for")
|
||||||
)
|
|
||||||
private List<String> projectNames = new ArrayList<>();
|
private List<String> projectNames = new ArrayList<>();
|
||||||
|
|
||||||
private Injector dbInjector;
|
private Injector dbInjector;
|
||||||
|
@ -57,10 +57,9 @@ public class SwitchSecureStore extends SiteProgram {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(SwitchSecureStore.class);
|
private static final Logger log = LoggerFactory.getLogger(SwitchSecureStore.class);
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--new-secure-store-lib",
|
name = "--new-secure-store-lib",
|
||||||
usage = "Path to new SecureStore implementation",
|
usage = "Path to new SecureStore implementation",
|
||||||
required = true
|
required = true)
|
||||||
)
|
|
||||||
private String newSecureStoreLib;
|
private String newSecureStoreLib;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,10 +64,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
|
|
||||||
public abstract class SiteProgram extends AbstractProgram {
|
public abstract class SiteProgram extends AbstractProgram {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--site-path",
|
name = "--site-path",
|
||||||
aliases = {"-d"},
|
aliases = {"-d"},
|
||||||
usage = "Local directory containing site data"
|
usage = "Local directory containing site data")
|
||||||
)
|
|
||||||
private void setSitePath(String path) {
|
private void setSitePath(String path) {
|
||||||
sitePath = Paths.get(path);
|
sitePath = Paths.get(path);
|
||||||
}
|
}
|
||||||
|
@ -39,11 +39,10 @@ class ListMetrics implements RestReadView<ConfigResource> {
|
|||||||
boolean dataOnly;
|
boolean dataOnly;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--prefix",
|
name = "--prefix",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "PREFIX",
|
metaVar = "PREFIX",
|
||||||
usage = "match metric by exact match or prefix"
|
usage = "match metric by exact match or prefix")
|
||||||
)
|
|
||||||
List<String> query = new ArrayList<>();
|
List<String> query = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -34,11 +34,10 @@ import org.kohsuke.args4j.Option;
|
|||||||
public class ListAccess implements RestReadView<TopLevelResource> {
|
public class ListAccess implements RestReadView<TopLevelResource> {
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project",
|
name = "--project",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "PROJECT",
|
metaVar = "PROJECT",
|
||||||
usage = "projects for which the access rights should be returned"
|
usage = "projects for which the access rights should be returned")
|
||||||
)
|
|
||||||
private List<String> projects = new ArrayList<>();
|
private List<String> projects = new ArrayList<>();
|
||||||
|
|
||||||
private final GetAccess getAccess;
|
private final GetAccess getAccess;
|
||||||
|
@ -31,10 +31,9 @@ public class GetAvatar implements RestReadView<AccountResource> {
|
|||||||
private int size;
|
private int size;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--size",
|
name = "--size",
|
||||||
aliases = {"-s"},
|
aliases = {"-s"},
|
||||||
usage = "recommended size in pixels, height and width"
|
usage = "recommended size in pixels, height and width")
|
||||||
)
|
|
||||||
public void setSize(int s) {
|
public void setSize(int s) {
|
||||||
size = s;
|
size = s;
|
||||||
}
|
}
|
||||||
|
@ -66,11 +66,10 @@ public class QueryAccounts implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of users to return"
|
usage = "maximum number of users to return")
|
||||||
)
|
|
||||||
public void setLimit(int n) {
|
public void setLimit(int n) {
|
||||||
queryProcessor.setUserProvidedLimit(n);
|
queryProcessor.setUserProvidedLimit(n);
|
||||||
|
|
||||||
@ -94,21 +93,19 @@ public class QueryAccounts implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--query",
|
name = "--query",
|
||||||
aliases = {"-q"},
|
aliases = {"-q"},
|
||||||
metaVar = "QUERY",
|
metaVar = "QUERY",
|
||||||
usage = "match users"
|
usage = "match users")
|
||||||
)
|
|
||||||
public void setQuery(String query) {
|
public void setQuery(String query) {
|
||||||
this.query = query;
|
this.query = query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "Number of accounts to skip"
|
usage = "Number of accounts to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
@ -380,10 +380,9 @@ public class ChangeEdits
|
|||||||
private final ProjectCache projectCache;
|
private final ProjectCache projectCache;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--base",
|
name = "--base",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
usage = "whether to load the content on the base revision instead of the change edit"
|
usage = "whether to load the content on the base revision instead of the change edit")
|
||||||
)
|
|
||||||
private boolean base;
|
private boolean base;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ -482,10 +481,9 @@ public class ChangeEdits
|
|||||||
private final ChangeEditUtil editUtil;
|
private final ChangeEditUtil editUtil;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--base",
|
name = "--base",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
usage = "whether to load the message on the base revision instead of the change edit"
|
usage = "whether to load the message on the base revision instead of the change edit")
|
||||||
)
|
|
||||||
private boolean base;
|
private boolean base;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -59,12 +59,11 @@ public class GetBlame implements RestReadView<FileResource> {
|
|||||||
private final AutoMerger autoMerger;
|
private final AutoMerger autoMerger;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--base",
|
name = "--base",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
usage =
|
usage =
|
||||||
"whether to load the blame of the base revision (the direct"
|
"whether to load the blame of the base revision (the direct"
|
||||||
+ " parent of the change) instead of the change"
|
+ " parent of the change) instead of the change")
|
||||||
)
|
|
||||||
private boolean base;
|
private boolean base;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -54,10 +54,9 @@ public class GetPureRevert implements RestReadView<ChangeResource> {
|
|||||||
private final PatchSetUtil psUtil;
|
private final PatchSetUtil psUtil;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--claimed-original",
|
name = "--claimed-original",
|
||||||
aliases = {"-o"},
|
aliases = {"-o"},
|
||||||
usage = "SHA1 (40 digit hex) of the original commit"
|
usage = "SHA1 (40 digit hex) of the original commit")
|
||||||
)
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private String claimedOriginal;
|
private String claimedOriginal;
|
||||||
|
|
||||||
|
@ -55,10 +55,9 @@ public class Mergeable implements RestReadView<RevisionResource> {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(Mergeable.class);
|
private static final Logger log = LoggerFactory.getLogger(Mergeable.class);
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--other-branches",
|
name = "--other-branches",
|
||||||
aliases = {"-o"},
|
aliases = {"-o"},
|
||||||
usage = "test mergeability for other branches too"
|
usage = "test mergeability for other branches too")
|
||||||
)
|
|
||||||
private boolean otherBranches;
|
private boolean otherBranches;
|
||||||
|
|
||||||
private final GitRepositoryManager gitManager;
|
private final GitRepositoryManager gitManager;
|
||||||
|
@ -43,10 +43,9 @@ public class SuggestChangeReviewers extends SuggestReviewers
|
|||||||
implements RestReadView<ChangeResource> {
|
implements RestReadView<ChangeResource> {
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--exclude-groups",
|
name = "--exclude-groups",
|
||||||
aliases = {"-e"},
|
aliases = {"-e"},
|
||||||
usage = "exclude groups from query"
|
usage = "exclude groups from query")
|
||||||
)
|
|
||||||
boolean excludeGroups;
|
boolean excludeGroups;
|
||||||
|
|
||||||
private final PermissionBackend permissionBackend;
|
private final PermissionBackend permissionBackend;
|
||||||
|
@ -39,21 +39,19 @@ public class SuggestReviewers {
|
|||||||
protected final int maxSuggestedReviewers;
|
protected final int maxSuggestedReviewers;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of reviewers to list"
|
usage = "maximum number of reviewers to list")
|
||||||
)
|
|
||||||
public void setLimit(int l) {
|
public void setLimit(int l) {
|
||||||
this.limit = l <= 0 ? maxSuggestedReviewers : Math.min(l, maxSuggestedReviewers);
|
this.limit = l <= 0 ? maxSuggestedReviewers : Math.min(l, maxSuggestedReviewers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--query",
|
name = "--query",
|
||||||
aliases = {"-q"},
|
aliases = {"-q"},
|
||||||
metaVar = "QUERY",
|
metaVar = "QUERY",
|
||||||
usage = "match reviewers query"
|
usage = "match reviewers query")
|
||||||
)
|
|
||||||
public void setQuery(String q) {
|
public void setQuery(String q) {
|
||||||
this.query = q;
|
this.query = q;
|
||||||
}
|
}
|
||||||
|
@ -1172,11 +1172,10 @@ class ReceiveCommits {
|
|||||||
String topic;
|
String topic;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--draft",
|
name = "--draft",
|
||||||
usage =
|
usage =
|
||||||
"Will be removed. Before that, this option will be mapped to '--private'"
|
"Will be removed. Before that, this option will be mapped to '--private'"
|
||||||
+ "for new changes and '--edit' for existing changes"
|
+ "for new changes and '--edit' for existing changes")
|
||||||
)
|
|
||||||
boolean draft;
|
boolean draft;
|
||||||
|
|
||||||
boolean publish;
|
boolean publish;
|
||||||
@ -1188,20 +1187,18 @@ class ReceiveCommits {
|
|||||||
boolean removePrivate;
|
boolean removePrivate;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--wip",
|
name = "--wip",
|
||||||
aliases = {"-work-in-progress"},
|
aliases = {"-work-in-progress"},
|
||||||
usage = "mark change as work in progress"
|
usage = "mark change as work in progress")
|
||||||
)
|
|
||||||
boolean workInProgress;
|
boolean workInProgress;
|
||||||
|
|
||||||
@Option(name = "--ready", usage = "mark change as ready")
|
@Option(name = "--ready", usage = "mark change as ready")
|
||||||
boolean ready;
|
boolean ready;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--edit",
|
name = "--edit",
|
||||||
aliases = {"-e"},
|
aliases = {"-e"},
|
||||||
usage = "upload as change edit"
|
usage = "upload as change edit")
|
||||||
)
|
|
||||||
boolean edit;
|
boolean edit;
|
||||||
|
|
||||||
@Option(name = "--submit", usage = "immediately submit the change")
|
@Option(name = "--submit", usage = "immediately submit the change")
|
||||||
@ -1214,19 +1211,17 @@ class ReceiveCommits {
|
|||||||
private boolean publishComments;
|
private boolean publishComments;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-publish-comments",
|
name = "--no-publish-comments",
|
||||||
aliases = {"--np"},
|
aliases = {"--np"},
|
||||||
usage = "do not publish draft comments"
|
usage = "do not publish draft comments")
|
||||||
)
|
|
||||||
private boolean noPublishComments;
|
private boolean noPublishComments;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--notify",
|
name = "--notify",
|
||||||
usage =
|
usage =
|
||||||
"Notify handling that defines to whom email notifications "
|
"Notify handling that defines to whom email notifications "
|
||||||
+ "should be sent. Allowed values are NONE, OWNER, "
|
+ "should be sent. Allowed values are NONE, OWNER, "
|
||||||
+ "OWNER_REVIEWERS, ALL. If not set, the default is ALL."
|
+ "OWNER_REVIEWERS, ALL. If not set, the default is ALL.")
|
||||||
)
|
|
||||||
private NotifyHandling notify;
|
private NotifyHandling notify;
|
||||||
|
|
||||||
@Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified")
|
@Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified")
|
||||||
@ -1239,11 +1234,10 @@ class ReceiveCommits {
|
|||||||
List<Account.Id> bccs = new ArrayList<>();
|
List<Account.Id> bccs = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--reviewer",
|
name = "--reviewer",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "EMAIL",
|
metaVar = "EMAIL",
|
||||||
usage = "add reviewer to changes"
|
usage = "add reviewer to changes")
|
||||||
)
|
|
||||||
void reviewer(Account.Id id) {
|
void reviewer(Account.Id id) {
|
||||||
reviewer.add(id);
|
reviewer.add(id);
|
||||||
}
|
}
|
||||||
@ -1254,11 +1248,10 @@ class ReceiveCommits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--label",
|
name = "--label",
|
||||||
aliases = {"-l"},
|
aliases = {"-l"},
|
||||||
metaVar = "LABEL+VALUE",
|
metaVar = "LABEL+VALUE",
|
||||||
usage = "label(s) to assign (defaults to +1 if no value provided"
|
usage = "label(s) to assign (defaults to +1 if no value provided")
|
||||||
)
|
|
||||||
void addLabel(String token) throws CmdLineException {
|
void addLabel(String token) throws CmdLineException {
|
||||||
LabelVote v = LabelVote.parse(token);
|
LabelVote v = LabelVote.parse(token);
|
||||||
try {
|
try {
|
||||||
@ -1271,11 +1264,10 @@ class ReceiveCommits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--message",
|
name = "--message",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MESSAGE",
|
metaVar = "MESSAGE",
|
||||||
usage = "Comment message to apply to the review"
|
usage = "Comment message to apply to the review")
|
||||||
)
|
|
||||||
void addMessage(String token) {
|
void addMessage(String token) {
|
||||||
// Many characters have special meaning in the context of a git ref.
|
// Many characters have special meaning in the context of a git ref.
|
||||||
//
|
//
|
||||||
@ -1293,11 +1285,10 @@ class ReceiveCommits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--hashtag",
|
name = "--hashtag",
|
||||||
aliases = {"-t"},
|
aliases = {"-t"},
|
||||||
metaVar = "HASHTAG",
|
metaVar = "HASHTAG",
|
||||||
usage = "add hashtag to changes"
|
usage = "add hashtag to changes")
|
||||||
)
|
|
||||||
void addHashtag(String token) throws CmdLineException {
|
void addHashtag(String token) throws CmdLineException {
|
||||||
if (!notesMigration.readChanges()) {
|
if (!notesMigration.readChanges()) {
|
||||||
throw clp.reject("cannot add hashtags; noteDb is disabled");
|
throw clp.reject("cannot add hashtags; noteDb is disabled");
|
||||||
|
@ -90,37 +90,33 @@ public class ListGroups implements RestReadView<TopLevelResource> {
|
|||||||
private String suggest;
|
private String suggest;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project",
|
name = "--project",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
usage = "projects for which the groups should be listed"
|
usage = "projects for which the groups should be listed")
|
||||||
)
|
|
||||||
public void addProject(ProjectControl project) {
|
public void addProject(ProjectControl project) {
|
||||||
projects.add(project);
|
projects.add(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--visible-to-all",
|
name = "--visible-to-all",
|
||||||
usage = "to list only groups that are visible to all registered users"
|
usage = "to list only groups that are visible to all registered users")
|
||||||
)
|
|
||||||
public void setVisibleToAll(boolean visibleToAll) {
|
public void setVisibleToAll(boolean visibleToAll) {
|
||||||
this.visibleToAll = visibleToAll;
|
this.visibleToAll = visibleToAll;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--user",
|
name = "--user",
|
||||||
aliases = {"-u"},
|
aliases = {"-u"},
|
||||||
usage = "user for which the groups should be listed"
|
usage = "user for which the groups should be listed")
|
||||||
)
|
|
||||||
public void setUser(Account.Id user) {
|
public void setUser(Account.Id user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--owned",
|
name = "--owned",
|
||||||
usage =
|
usage =
|
||||||
"to list only groups that are owned by the"
|
"to list only groups that are owned by the"
|
||||||
+ " specified user or by the calling user if no user was specifed"
|
+ " specified user or by the calling user if no user was specifed")
|
||||||
)
|
|
||||||
public void setOwned(boolean owned) {
|
public void setOwned(boolean owned) {
|
||||||
this.owned = owned;
|
this.owned = owned;
|
||||||
}
|
}
|
||||||
@ -133,68 +129,61 @@ public class ListGroups implements RestReadView<TopLevelResource> {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Option(
|
@Option(
|
||||||
name = "--query",
|
name = "--query",
|
||||||
aliases = {"-q"},
|
aliases = {"-q"},
|
||||||
usage = "group to inspect (deprecated: use --group/-g instead)"
|
usage = "group to inspect (deprecated: use --group/-g instead)")
|
||||||
)
|
|
||||||
void addGroup_Deprecated(AccountGroup.UUID uuid) {
|
void addGroup_Deprecated(AccountGroup.UUID uuid) {
|
||||||
addGroup(uuid);
|
addGroup(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--group",
|
name = "--group",
|
||||||
aliases = {"-g"},
|
aliases = {"-g"},
|
||||||
usage = "group to inspect"
|
usage = "group to inspect")
|
||||||
)
|
|
||||||
public void addGroup(AccountGroup.UUID uuid) {
|
public void addGroup(AccountGroup.UUID uuid) {
|
||||||
groupsToInspect.add(uuid);
|
groupsToInspect.add(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of groups to list"
|
usage = "maximum number of groups to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of groups to skip"
|
usage = "number of groups to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--match",
|
name = "--match",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MATCH",
|
metaVar = "MATCH",
|
||||||
usage = "match group substring"
|
usage = "match group substring")
|
||||||
)
|
|
||||||
public void setMatchSubstring(String matchSubstring) {
|
public void setMatchSubstring(String matchSubstring) {
|
||||||
this.matchSubstring = matchSubstring;
|
this.matchSubstring = matchSubstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--regex",
|
name = "--regex",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "REGEX",
|
metaVar = "REGEX",
|
||||||
usage = "match group regex"
|
usage = "match group regex")
|
||||||
)
|
|
||||||
public void setMatchRegex(String matchRegex) {
|
public void setMatchRegex(String matchRegex) {
|
||||||
this.matchRegex = matchRegex;
|
this.matchRegex = matchRegex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--suggest",
|
name = "--suggest",
|
||||||
aliases = {"-s"},
|
aliases = {"-s"},
|
||||||
usage = "to get a suggestion of groups"
|
usage = "to get a suggestion of groups")
|
||||||
)
|
|
||||||
public void setSuggest(String suggest) {
|
public void setSuggest(String suggest) {
|
||||||
this.suggest = suggest;
|
this.suggest = suggest;
|
||||||
}
|
}
|
||||||
|
@ -50,30 +50,27 @@ public class QueryGroups implements RestReadView<TopLevelResource> {
|
|||||||
// removed we want to rename --query2 to --query here.
|
// removed we want to rename --query2 to --query here.
|
||||||
/** --query (-q) is already used by {@link ListGroups} */
|
/** --query (-q) is already used by {@link ListGroups} */
|
||||||
@Option(
|
@Option(
|
||||||
name = "--query2",
|
name = "--query2",
|
||||||
aliases = {"-q2"},
|
aliases = {"-q2"},
|
||||||
usage = "group query"
|
usage = "group query")
|
||||||
)
|
|
||||||
public void setQuery(String query) {
|
public void setQuery(String query) {
|
||||||
this.query = query;
|
this.query = query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of groups to list"
|
usage = "maximum number of groups to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of groups to skip"
|
usage = "number of groups to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
@ -47,50 +47,45 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
|
|||||||
private String matchRegex;
|
private String matchRegex;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--all",
|
name = "--all",
|
||||||
aliases = {"-a"},
|
aliases = {"-a"},
|
||||||
usage = "List all plugins, including disabled plugins"
|
usage = "List all plugins, including disabled plugins")
|
||||||
)
|
|
||||||
public void setAll(boolean all) {
|
public void setAll(boolean all) {
|
||||||
this.all = all;
|
this.all = all;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of plugins to list"
|
usage = "maximum number of plugins to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of plugins to skip"
|
usage = "number of plugins to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--prefix",
|
name = "--prefix",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "PREFIX",
|
metaVar = "PREFIX",
|
||||||
usage = "match plugin prefix"
|
usage = "match plugin prefix")
|
||||||
)
|
|
||||||
public void setMatchPrefix(String matchPrefix) {
|
public void setMatchPrefix(String matchPrefix) {
|
||||||
this.matchPrefix = matchPrefix;
|
this.matchPrefix = matchPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--match",
|
name = "--match",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MATCH",
|
metaVar = "MATCH",
|
||||||
usage = "match plugin substring"
|
usage = "match plugin substring")
|
||||||
)
|
|
||||||
public void setMatchSubstring(String matchSubstring) {
|
public void setMatchSubstring(String matchSubstring) {
|
||||||
this.matchSubstring = matchSubstring;
|
this.matchSubstring = matchSubstring;
|
||||||
}
|
}
|
||||||
|
@ -42,23 +42,21 @@ public class CheckMergeability implements RestReadView<BranchResource> {
|
|||||||
private SubmitType submitType;
|
private SubmitType submitType;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--source",
|
name = "--source",
|
||||||
metaVar = "COMMIT",
|
metaVar = "COMMIT",
|
||||||
usage =
|
usage =
|
||||||
"the source reference to merge, which could be any git object "
|
"the source reference to merge, which could be any git object "
|
||||||
+ "references expression, refer to "
|
+ "references expression, refer to "
|
||||||
+ "org.eclipse.jgit.lib.Repository#resolve(String)",
|
+ "org.eclipse.jgit.lib.Repository#resolve(String)",
|
||||||
required = true
|
required = true)
|
||||||
)
|
|
||||||
public void setSource(String source) {
|
public void setSource(String source) {
|
||||||
this.source = source;
|
this.source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--strategy",
|
name = "--strategy",
|
||||||
metaVar = "STRATEGY",
|
metaVar = "STRATEGY",
|
||||||
usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy"
|
usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy")
|
||||||
)
|
|
||||||
public void setStrategy(String strategy) {
|
public void setStrategy(String strategy) {
|
||||||
this.strategy = strategy;
|
this.strategy = strategy;
|
||||||
}
|
}
|
||||||
|
@ -42,37 +42,34 @@ public class GetReflog implements RestReadView<BranchResource> {
|
|||||||
private final GitRepositoryManager repoManager;
|
private final GitRepositoryManager repoManager;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of reflog entries to list"
|
usage = "maximum number of reflog entries to list")
|
||||||
)
|
|
||||||
public GetReflog setLimit(int limit) {
|
public GetReflog setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--from",
|
name = "--from",
|
||||||
metaVar = "TIMESTAMP",
|
metaVar = "TIMESTAMP",
|
||||||
usage =
|
usage =
|
||||||
"timestamp from which the reflog entries should be listed (UTC, format: "
|
"timestamp from which the reflog entries should be listed (UTC, format: "
|
||||||
+ TimestampHandler.TIMESTAMP_FORMAT
|
+ TimestampHandler.TIMESTAMP_FORMAT
|
||||||
+ ")"
|
+ ")")
|
||||||
)
|
|
||||||
public GetReflog setFrom(Timestamp from) {
|
public GetReflog setFrom(Timestamp from) {
|
||||||
this.from = from;
|
this.from = from;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--to",
|
name = "--to",
|
||||||
metaVar = "TIMESTAMP",
|
metaVar = "TIMESTAMP",
|
||||||
usage =
|
usage =
|
||||||
"timestamp until which the reflog entries should be listed (UTC, format: "
|
"timestamp until which the reflog entries should be listed (UTC, format: "
|
||||||
+ TimestampHandler.TIMESTAMP_FORMAT
|
+ TimestampHandler.TIMESTAMP_FORMAT
|
||||||
+ ")"
|
+ ")")
|
||||||
)
|
|
||||||
public GetReflog setTo(Timestamp to) {
|
public GetReflog setTo(Timestamp to) {
|
||||||
this.to = to;
|
this.to = to;
|
||||||
return this;
|
return this;
|
||||||
|
@ -60,41 +60,37 @@ public class ListBranches implements RestReadView<ProjectResource> {
|
|||||||
private final WebLinks webLinks;
|
private final WebLinks webLinks;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of branches to list"
|
usage = "maximum number of branches to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S", "-s"},
|
aliases = {"-S", "-s"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of branches to skip"
|
usage = "number of branches to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--match",
|
name = "--match",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MATCH",
|
metaVar = "MATCH",
|
||||||
usage = "match branches substring"
|
usage = "match branches substring")
|
||||||
)
|
|
||||||
public void setMatchSubstring(String matchSubstring) {
|
public void setMatchSubstring(String matchSubstring) {
|
||||||
this.matchSubstring = matchSubstring;
|
this.matchSubstring = matchSubstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--regex",
|
name = "--regex",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "REGEX",
|
metaVar = "REGEX",
|
||||||
usage = "match branches regex"
|
usage = "match branches regex")
|
||||||
)
|
|
||||||
public void setMatchRegex(String matchRegex) {
|
public void setMatchRegex(String matchRegex) {
|
||||||
this.matchRegex = matchRegex;
|
this.matchRegex = matchRegex;
|
||||||
}
|
}
|
||||||
|
@ -152,21 +152,19 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
|||||||
private OutputFormat format = OutputFormat.TEXT;
|
private OutputFormat format = OutputFormat.TEXT;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--show-branch",
|
name = "--show-branch",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
usage = "displays the sha of each project in the specified branch"
|
usage = "displays the sha of each project in the specified branch")
|
||||||
)
|
|
||||||
public void addShowBranch(String branch) {
|
public void addShowBranch(String branch) {
|
||||||
showBranch.add(branch);
|
showBranch.add(branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--tree",
|
name = "--tree",
|
||||||
aliases = {"-t"},
|
aliases = {"-t"},
|
||||||
usage =
|
usage =
|
||||||
"displays project inheritance in a tree-like format\n"
|
"displays project inheritance in a tree-like format\n"
|
||||||
+ "this option does not work together with the show-branch option"
|
+ "this option does not work together with the show-branch option")
|
||||||
)
|
|
||||||
public void setShowTree(boolean showTree) {
|
public void setShowTree(boolean showTree) {
|
||||||
this.showTree = showTree;
|
this.showTree = showTree;
|
||||||
}
|
}
|
||||||
@ -177,10 +175,9 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--description",
|
name = "--description",
|
||||||
aliases = {"-d"},
|
aliases = {"-d"},
|
||||||
usage = "include description of project in list"
|
usage = "include description of project in list")
|
||||||
)
|
|
||||||
public void setShowDescription(boolean showDescription) {
|
public void setShowDescription(boolean showDescription) {
|
||||||
this.showDescription = showDescription;
|
this.showDescription = showDescription;
|
||||||
}
|
}
|
||||||
@ -191,41 +188,37 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of projects to list"
|
usage = "maximum number of projects to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of projects to skip"
|
usage = "number of projects to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--prefix",
|
name = "--prefix",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "PREFIX",
|
metaVar = "PREFIX",
|
||||||
usage = "match project prefix"
|
usage = "match project prefix")
|
||||||
)
|
|
||||||
public void setMatchPrefix(String matchPrefix) {
|
public void setMatchPrefix(String matchPrefix) {
|
||||||
this.matchPrefix = matchPrefix;
|
this.matchPrefix = matchPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--match",
|
name = "--match",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MATCH",
|
metaVar = "MATCH",
|
||||||
usage = "match project substring"
|
usage = "match project substring")
|
||||||
)
|
|
||||||
public void setMatchSubstring(String matchSubstring) {
|
public void setMatchSubstring(String matchSubstring) {
|
||||||
this.matchSubstring = matchSubstring;
|
this.matchSubstring = matchSubstring;
|
||||||
}
|
}
|
||||||
@ -236,10 +229,9 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--has-acl-for",
|
name = "--has-acl-for",
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "displays only projects on which access rights for this group are directly assigned"
|
usage = "displays only projects on which access rights for this group are directly assigned")
|
||||||
)
|
|
||||||
public void setGroupUuid(AccountGroup.UUID groupUuid) {
|
public void setGroupUuid(AccountGroup.UUID groupUuid) {
|
||||||
this.groupUuid = groupUuid;
|
this.groupUuid = groupUuid;
|
||||||
}
|
}
|
||||||
|
@ -57,41 +57,37 @@ public class ListTags implements RestReadView<ProjectResource> {
|
|||||||
private final WebLinks links;
|
private final WebLinks links;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "maximum number of tags to list"
|
usage = "maximum number of tags to list")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S", "-s"},
|
aliases = {"-S", "-s"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "number of tags to skip"
|
usage = "number of tags to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--match",
|
name = "--match",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "MATCH",
|
metaVar = "MATCH",
|
||||||
usage = "match tags substring"
|
usage = "match tags substring")
|
||||||
)
|
|
||||||
public void setMatchSubstring(String matchSubstring) {
|
public void setMatchSubstring(String matchSubstring) {
|
||||||
this.matchSubstring = matchSubstring;
|
this.matchSubstring = matchSubstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--regex",
|
name = "--regex",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "REGEX",
|
metaVar = "REGEX",
|
||||||
usage = "match tags regex"
|
usage = "match tags regex")
|
||||||
)
|
|
||||||
public void setMatchRegex(String matchRegex) {
|
public void setMatchRegex(String matchRegex) {
|
||||||
this.matchRegex = matchRegex;
|
this.matchRegex = matchRegex;
|
||||||
}
|
}
|
||||||
|
@ -42,19 +42,17 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
|
|||||||
private EnumSet<ListChangesOption> options;
|
private EnumSet<ListChangesOption> options;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--query",
|
name = "--query",
|
||||||
aliases = {"-q"},
|
aliases = {"-q"},
|
||||||
metaVar = "QUERY",
|
metaVar = "QUERY",
|
||||||
usage = "Query string"
|
usage = "Query string")
|
||||||
)
|
|
||||||
private List<String> queries;
|
private List<String> queries;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--limit",
|
name = "--limit",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "Maximum number of results to return"
|
usage = "Maximum number of results to return")
|
||||||
)
|
|
||||||
public void setLimit(int limit) {
|
public void setLimit(int limit) {
|
||||||
imp.setUserProvidedLimit(limit);
|
imp.setUserProvidedLimit(limit);
|
||||||
}
|
}
|
||||||
@ -70,11 +68,10 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
metaVar = "CNT",
|
metaVar = "CNT",
|
||||||
usage = "Number of changes to skip"
|
usage = "Number of changes to skip")
|
||||||
)
|
|
||||||
public void setStart(int start) {
|
public void setStart(int start) {
|
||||||
imp.setStart(start);
|
imp.setStart(start);
|
||||||
}
|
}
|
||||||
|
@ -45,41 +45,36 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "set-project-parent",
|
name = "set-project-parent",
|
||||||
description = "Change the project permissions are inherited from"
|
description = "Change the project permissions are inherited from")
|
||||||
)
|
|
||||||
final class AdminSetParent extends SshCommand {
|
final class AdminSetParent extends SshCommand {
|
||||||
private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class);
|
private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class);
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--parent",
|
name = "--parent",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "new parent project"
|
usage = "new parent project")
|
||||||
)
|
|
||||||
private ProjectControl newParent;
|
private ProjectControl newParent;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--children-of",
|
name = "--children-of",
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "parent project for which the child projects should be reparented"
|
usage = "parent project for which the child projects should be reparented")
|
||||||
)
|
|
||||||
private ProjectControl oldParent;
|
private ProjectControl oldParent;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--exclude",
|
name = "--exclude",
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "child project of old parent project which should not be reparented"
|
usage = "child project of old parent project which should not be reparented")
|
||||||
)
|
|
||||||
private List<ProjectControl> excludedChildren = new ArrayList<>();
|
private List<ProjectControl> excludedChildren = new ArrayList<>();
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = false,
|
required = false,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "projects to modify"
|
usage = "projects to modify")
|
||||||
)
|
|
||||||
private List<ProjectControl> children = new ArrayList<>();
|
private List<ProjectControl> children = new ArrayList<>();
|
||||||
|
|
||||||
@Inject private ProjectCache projectCache;
|
@Inject private ProjectCache projectCache;
|
||||||
|
@ -27,10 +27,9 @@ import java.util.List;
|
|||||||
import org.kohsuke.args4j.Argument;
|
import org.kohsuke.args4j.Argument;
|
||||||
|
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "apropos",
|
name = "apropos",
|
||||||
description = "Search in Gerrit documentation",
|
description = "Search in Gerrit documentation",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class AproposCommand extends SshCommand {
|
final class AproposCommand extends SshCommand {
|
||||||
@Inject private QueryDocumentationExecutor searcher;
|
@Inject private QueryDocumentationExecutor searcher;
|
||||||
@Inject @CanonicalWebUrl String url;
|
@Inject @CanonicalWebUrl String url;
|
||||||
|
@ -32,34 +32,30 @@ import org.kohsuke.args4j.Argument;
|
|||||||
import org.kohsuke.args4j.Option;
|
import org.kohsuke.args4j.Option;
|
||||||
|
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ban-commit",
|
name = "ban-commit",
|
||||||
description = "Ban a commit from a project's repository",
|
description = "Ban a commit from a project's repository",
|
||||||
runsAt = MASTER
|
runsAt = MASTER)
|
||||||
)
|
|
||||||
public class BanCommitCommand extends SshCommand {
|
public class BanCommitCommand extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--reason",
|
name = "--reason",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "REASON",
|
metaVar = "REASON",
|
||||||
usage = "reason for banning the commit"
|
usage = "reason for banning the commit")
|
||||||
)
|
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "PROJECT",
|
metaVar = "PROJECT",
|
||||||
usage = "name of the project for which the commit should be banned"
|
usage = "name of the project for which the commit should be banned")
|
||||||
)
|
|
||||||
private ProjectControl projectControl;
|
private ProjectControl projectControl;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 1,
|
index = 1,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "COMMIT",
|
metaVar = "COMMIT",
|
||||||
usage = "commit(s) that should be banned"
|
usage = "commit(s) that should be banned")
|
||||||
)
|
|
||||||
private List<ObjectId> commitsToBan = new ArrayList<>();
|
private List<ObjectId> commitsToBan = new ArrayList<>();
|
||||||
|
|
||||||
@Inject private BanCommit banCommit;
|
@Inject private BanCommit banCommit;
|
||||||
|
@ -42,17 +42,15 @@ abstract class BaseTestPrologCommand extends SshCommand {
|
|||||||
protected String changeId;
|
protected String changeId;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "-s",
|
name = "-s",
|
||||||
usage =
|
usage =
|
||||||
"Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch"
|
"Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch")
|
||||||
)
|
|
||||||
protected boolean useStdin;
|
protected boolean useStdin;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-filters",
|
name = "--no-filters",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
usage = "Don't run the submit_filter/2 from the parent projects"
|
usage = "Don't run the submit_filter/2 from the parent projects")
|
||||||
)
|
|
||||||
void setNoFilters(boolean no) {
|
void setNoFilters(boolean no) {
|
||||||
input.filters = no ? Filters.SKIP : Filters.RUN;
|
input.filters = no ? Filters.SKIP : Filters.RUN;
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
@AdminHighPriorityCommand
|
@AdminHighPriorityCommand
|
||||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "close-connection",
|
name = "close-connection",
|
||||||
description = "Close the specified SSH connection",
|
description = "Close the specified SSH connection",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class CloseConnection extends SshCommand {
|
final class CloseConnection extends SshCommand {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(CloseConnection.class);
|
private static final Logger log = LoggerFactory.getLogger(CloseConnection.class);
|
||||||
@ -51,12 +50,11 @@ final class CloseConnection extends SshCommand {
|
|||||||
@Inject private SshDaemon sshDaemon;
|
@Inject private SshDaemon sshDaemon;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "SESSION_ID",
|
metaVar = "SESSION_ID",
|
||||||
usage = "List of SSH session IDs to be closed"
|
usage = "List of SSH session IDs to be closed")
|
||||||
)
|
|
||||||
private final List<String> sessionIds = new ArrayList<>();
|
private final List<String> sessionIds = new ArrayList<>();
|
||||||
|
|
||||||
@Option(name = "--wait", usage = "wait for connection to close before exiting")
|
@Option(name = "--wait", usage = "wait for connection to close before exiting")
|
||||||
|
@ -42,11 +42,10 @@ import org.kohsuke.args4j.Option;
|
|||||||
@CommandMetaData(name = "create-account", description = "Create a new batch/role account")
|
@CommandMetaData(name = "create-account", description = "Create a new batch/role account")
|
||||||
final class CreateAccountCommand extends SshCommand {
|
final class CreateAccountCommand extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--group",
|
name = "--group",
|
||||||
aliases = {"-g"},
|
aliases = {"-g"},
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "groups to add account to"
|
usage = "groups to add account to")
|
||||||
)
|
|
||||||
private List<AccountGroup.Id> groups = new ArrayList<>();
|
private List<AccountGroup.Id> groups = new ArrayList<>();
|
||||||
|
|
||||||
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
|
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
|
||||||
@ -59,10 +58,9 @@ final class CreateAccountCommand extends SshCommand {
|
|||||||
private String sshKey;
|
private String sshKey;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--http-password",
|
name = "--http-password",
|
||||||
metaVar = "PASSWORD",
|
metaVar = "PASSWORD",
|
||||||
usage = "password for HTTP authentication"
|
usage = "password for HTTP authentication")
|
||||||
)
|
|
||||||
private String httpPassword;
|
private String httpPassword;
|
||||||
|
|
||||||
@Argument(index = 0, required = true, metaVar = "USERNAME", usage = "name of the user account")
|
@Argument(index = 0, required = true, metaVar = "USERNAME", usage = "name of the user account")
|
||||||
|
@ -34,11 +34,10 @@ public final class CreateBranchCommand extends SshCommand {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 2,
|
index = 2,
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "REVISION",
|
metaVar = "REVISION",
|
||||||
usage = "base revision of the new branch"
|
usage = "base revision of the new branch")
|
||||||
)
|
|
||||||
private String revision;
|
private String revision;
|
||||||
|
|
||||||
@Inject GerritApi gApi;
|
@Inject GerritApi gApi;
|
||||||
|
@ -50,19 +50,17 @@ import org.kohsuke.args4j.Option;
|
|||||||
@CommandMetaData(name = "create-group", description = "Create a new account group")
|
@CommandMetaData(name = "create-group", description = "Create a new account group")
|
||||||
final class CreateGroupCommand extends SshCommand {
|
final class CreateGroupCommand extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--owner",
|
name = "--owner",
|
||||||
aliases = {"-o"},
|
aliases = {"-o"},
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "owning group, if not specified the group will be self-owning"
|
usage = "owning group, if not specified the group will be self-owning")
|
||||||
)
|
|
||||||
private AccountGroup.Id ownerGroupId;
|
private AccountGroup.Id ownerGroupId;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--description",
|
name = "--description",
|
||||||
aliases = {"-d"},
|
aliases = {"-d"},
|
||||||
metaVar = "DESC",
|
metaVar = "DESC",
|
||||||
usage = "description of group"
|
usage = "description of group")
|
||||||
)
|
|
||||||
private String groupDescription = "";
|
private String groupDescription = "";
|
||||||
|
|
||||||
@Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created")
|
@Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created")
|
||||||
@ -71,11 +69,10 @@ final class CreateGroupCommand extends SshCommand {
|
|||||||
private final Set<Account.Id> initialMembers = new HashSet<>();
|
private final Set<Account.Id> initialMembers = new HashSet<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--member",
|
name = "--member",
|
||||||
aliases = {"-m"},
|
aliases = {"-m"},
|
||||||
metaVar = "USERNAME",
|
metaVar = "USERNAME",
|
||||||
usage = "initial set of users to become members of the group"
|
usage = "initial set of users to become members of the group")
|
||||||
)
|
|
||||||
void addMember(Account.Id id) {
|
void addMember(Account.Id id) {
|
||||||
initialMembers.add(id);
|
initialMembers.add(id);
|
||||||
}
|
}
|
||||||
@ -86,11 +83,10 @@ final class CreateGroupCommand extends SshCommand {
|
|||||||
private final Set<AccountGroup.UUID> initialGroups = new HashSet<>();
|
private final Set<AccountGroup.UUID> initialGroups = new HashSet<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--group",
|
name = "--group",
|
||||||
aliases = "-g",
|
aliases = "-g",
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "initial set of groups to be included in the group"
|
usage = "initial set of groups to be included in the group")
|
||||||
)
|
|
||||||
void addGroup(AccountGroup.UUID id) {
|
void addGroup(AccountGroup.UUID id) {
|
||||||
initialGroups.add(id);
|
initialGroups.add(id);
|
||||||
}
|
}
|
||||||
|
@ -42,50 +42,44 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Create a new project. * */
|
/** Create a new project. * */
|
||||||
@RequiresCapability(GlobalCapability.CREATE_PROJECT)
|
@RequiresCapability(GlobalCapability.CREATE_PROJECT)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "create-project",
|
name = "create-project",
|
||||||
description = "Create a new project and associated Git repository"
|
description = "Create a new project and associated Git repository")
|
||||||
)
|
|
||||||
final class CreateProjectCommand extends SshCommand {
|
final class CreateProjectCommand extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--suggest-parents",
|
name = "--suggest-parents",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
usage =
|
usage =
|
||||||
"suggest parent candidates, "
|
"suggest parent candidates, "
|
||||||
+ "if this option is used all other options and arguments are ignored"
|
+ "if this option is used all other options and arguments are ignored")
|
||||||
)
|
|
||||||
private boolean suggestParent;
|
private boolean suggestParent;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--owner",
|
name = "--owner",
|
||||||
aliases = {"-o"},
|
aliases = {"-o"},
|
||||||
usage = "owner(s) of project"
|
usage = "owner(s) of project")
|
||||||
)
|
|
||||||
private List<AccountGroup.UUID> ownerIds;
|
private List<AccountGroup.UUID> ownerIds;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--parent",
|
name = "--parent",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "parent project"
|
usage = "parent project")
|
||||||
)
|
|
||||||
private ProjectControl newParent;
|
private ProjectControl newParent;
|
||||||
|
|
||||||
@Option(name = "--permissions-only", usage = "create project for use only as parent")
|
@Option(name = "--permissions-only", usage = "create project for use only as parent")
|
||||||
private boolean permissionsOnly;
|
private boolean permissionsOnly;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--description",
|
name = "--description",
|
||||||
aliases = {"-d"},
|
aliases = {"-d"},
|
||||||
metaVar = "DESCRIPTION",
|
metaVar = "DESCRIPTION",
|
||||||
usage = "description of project"
|
usage = "description of project")
|
||||||
)
|
|
||||||
private String projectDescription = "";
|
private String projectDescription = "";
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--submit-type",
|
name = "--submit-type",
|
||||||
aliases = {"-t"},
|
aliases = {"-t"},
|
||||||
usage = "project submit type"
|
usage = "project submit type")
|
||||||
)
|
|
||||||
private SubmitType submitType;
|
private SubmitType submitType;
|
||||||
|
|
||||||
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
|
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
|
||||||
@ -101,25 +95,22 @@ final class CreateProjectCommand extends SshCommand {
|
|||||||
private InheritableBoolean requireChangeID = InheritableBoolean.INHERIT;
|
private InheritableBoolean requireChangeID = InheritableBoolean.INHERIT;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--new-change-for-all-not-in-target",
|
name = "--new-change-for-all-not-in-target",
|
||||||
usage = "if a new change will be created for every commit not in target branch"
|
usage = "if a new change will be created for every commit not in target branch")
|
||||||
)
|
|
||||||
private InheritableBoolean createNewChangeForAllNotInTarget = InheritableBoolean.INHERIT;
|
private InheritableBoolean createNewChangeForAllNotInTarget = InheritableBoolean.INHERIT;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--use-contributor-agreements",
|
name = "--use-contributor-agreements",
|
||||||
aliases = {"--ca"},
|
aliases = {"--ca"},
|
||||||
usage = "if contributor agreement is required"
|
usage = "if contributor agreement is required")
|
||||||
)
|
|
||||||
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
||||||
contributorAgreements = InheritableBoolean.TRUE;
|
contributorAgreements = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--use-signed-off-by",
|
name = "--use-signed-off-by",
|
||||||
aliases = {"--so"},
|
aliases = {"--so"},
|
||||||
usage = "if signed-off-by is required"
|
usage = "if signed-off-by is required")
|
||||||
)
|
|
||||||
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
||||||
signedOffBy = InheritableBoolean.TRUE;
|
signedOffBy = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
@ -130,29 +121,26 @@ final class CreateProjectCommand extends SshCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--require-change-id",
|
name = "--require-change-id",
|
||||||
aliases = {"--id"},
|
aliases = {"--id"},
|
||||||
usage = "if change-id is required"
|
usage = "if change-id is required")
|
||||||
)
|
|
||||||
void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
|
void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
|
||||||
requireChangeID = InheritableBoolean.TRUE;
|
requireChangeID = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--create-new-change-for-all-not-in-target",
|
name = "--create-new-change-for-all-not-in-target",
|
||||||
aliases = {"--ncfa"},
|
aliases = {"--ncfa"},
|
||||||
usage = "if a new change will be created for every commit not in target branch"
|
usage = "if a new change will be created for every commit not in target branch")
|
||||||
)
|
|
||||||
void setNewChangeForAllNotInTarget(@SuppressWarnings("unused") boolean on) {
|
void setNewChangeForAllNotInTarget(@SuppressWarnings("unused") boolean on) {
|
||||||
createNewChangeForAllNotInTarget = InheritableBoolean.TRUE;
|
createNewChangeForAllNotInTarget = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--branch",
|
name = "--branch",
|
||||||
aliases = {"-b"},
|
aliases = {"-b"},
|
||||||
metaVar = "BRANCH",
|
metaVar = "BRANCH",
|
||||||
usage = "initial branch name\n(default: master)"
|
usage = "initial branch name\n(default: master)")
|
||||||
)
|
|
||||||
private List<String> branch;
|
private List<String> branch;
|
||||||
|
|
||||||
@Option(name = "--empty-commit", usage = "to create initial empty commit")
|
@Option(name = "--empty-commit", usage = "to create initial empty commit")
|
||||||
@ -162,9 +150,8 @@ final class CreateProjectCommand extends SshCommand {
|
|||||||
private String maxObjectSizeLimit;
|
private String maxObjectSizeLimit;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--plugin-config",
|
name = "--plugin-config",
|
||||||
usage = "plugin configuration parameter with format '<plugin-name>.<parameter-name>=<value>'"
|
usage = "plugin configuration parameter with format '<plugin-name>.<parameter-name>=<value>'")
|
||||||
)
|
|
||||||
private List<String> pluginConfigValues;
|
private List<String> pluginConfigValues;
|
||||||
|
|
||||||
@Argument(index = 0, metaVar = "NAME", usage = "name of project to be created")
|
@Argument(index = 0, metaVar = "NAME", usage = "name of project to be created")
|
||||||
|
@ -37,10 +37,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Causes the caches to purge all entries and reload. */
|
/** Causes the caches to purge all entries and reload. */
|
||||||
@RequiresAnyCapability({FLUSH_CACHES, MAINTAIN_SERVER})
|
@RequiresAnyCapability({FLUSH_CACHES, MAINTAIN_SERVER})
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "flush-caches",
|
name = "flush-caches",
|
||||||
description = "Flush some/all server caches from memory",
|
description = "Flush some/all server caches from memory",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class FlushCaches extends SshCommand {
|
final class FlushCaches extends SshCommand {
|
||||||
@Option(name = "--cache", usage = "flush named cache", metaVar = "NAME")
|
@Option(name = "--cache", usage = "flush named cache", metaVar = "NAME")
|
||||||
private List<String> caches = new ArrayList<>();
|
private List<String> caches = new ArrayList<>();
|
||||||
|
@ -48,12 +48,11 @@ public class GarbageCollectionCommand extends SshCommand {
|
|||||||
private boolean aggressive;
|
private boolean aggressive;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = false,
|
required = false,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "NAME",
|
metaVar = "NAME",
|
||||||
usage = "projects for which the Git garbage collection should be run"
|
usage = "projects for which the Git garbage collection should be run")
|
||||||
)
|
|
||||||
private List<ProjectControl> projects = new ArrayList<>();
|
private List<ProjectControl> projects = new ArrayList<>();
|
||||||
|
|
||||||
@Inject private ProjectCache projectCache;
|
@Inject private ProjectCache projectCache;
|
||||||
|
@ -34,12 +34,11 @@ final class IndexChangesCommand extends SshCommand {
|
|||||||
@Inject private ChangeArgumentParser changeArgumentParser;
|
@Inject private ChangeArgumentParser changeArgumentParser;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "CHANGE",
|
metaVar = "CHANGE",
|
||||||
usage = "changes to index"
|
usage = "changes to index")
|
||||||
)
|
|
||||||
void addChange(String token) {
|
void addChange(String token) {
|
||||||
try {
|
try {
|
||||||
changeArgumentParser.addChange(token, changes, null, false);
|
changeArgumentParser.addChange(token, changes, null, false);
|
||||||
|
@ -34,12 +34,11 @@ final class IndexProjectCommand extends SshCommand {
|
|||||||
@Inject private Index index;
|
@Inject private Index index;
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "PROJECT",
|
metaVar = "PROJECT",
|
||||||
usage = "projects for which the changes should be indexed"
|
usage = "projects for which the changes should be indexed")
|
||||||
)
|
|
||||||
private List<ProjectControl> projects = new ArrayList<>();
|
private List<ProjectControl> projects = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,23 +33,21 @@ import java.util.Optional;
|
|||||||
import org.kohsuke.args4j.Option;
|
import org.kohsuke.args4j.Option;
|
||||||
|
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ls-groups",
|
name = "ls-groups",
|
||||||
description = "List groups visible to the caller",
|
description = "List groups visible to the caller",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class ListGroupsCommand extends SshCommand {
|
public class ListGroupsCommand extends SshCommand {
|
||||||
@Inject private GroupCache groupCache;
|
@Inject private GroupCache groupCache;
|
||||||
|
|
||||||
@Inject @Options public ListGroups listGroups;
|
@Inject @Options public ListGroups listGroups;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--verbose",
|
name = "--verbose",
|
||||||
aliases = {"-v"},
|
aliases = {"-v"},
|
||||||
usage =
|
usage =
|
||||||
"verbose output format with tab-separated columns for the "
|
"verbose output format with tab-separated columns for the "
|
||||||
+ "group name, UUID, description, owner group name, "
|
+ "group name, UUID, description, owner group name, "
|
||||||
+ "owner group UUID, and whether the group is visible to all"
|
+ "owner group UUID, and whether the group is visible to all")
|
||||||
)
|
|
||||||
private boolean verboseOutput;
|
private boolean verboseOutput;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,10 +29,9 @@ import org.kohsuke.args4j.Argument;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ls-level",
|
name = "ls-level",
|
||||||
description = "list the level of loggers",
|
description = "list the level of loggers",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class ListLoggingLevelCommand extends SshCommand {
|
public class ListLoggingLevelCommand extends SshCommand {
|
||||||
|
|
||||||
@Argument(index = 0, required = false, metaVar = "NAME", usage = "used to match loggers")
|
@Argument(index = 0, required = false, metaVar = "NAME", usage = "used to match loggers")
|
||||||
|
@ -37,10 +37,9 @@ import org.kohsuke.args4j.Argument;
|
|||||||
|
|
||||||
/** Implements a command that allows the user to see the members of a group. */
|
/** Implements a command that allows the user to see the members of a group. */
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ls-members",
|
name = "ls-members",
|
||||||
description = "List the members of a given group",
|
description = "List the members of a given group",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class ListMembersCommand extends SshCommand {
|
public class ListMembersCommand extends SshCommand {
|
||||||
@Inject ListMembersCommandImpl impl;
|
@Inject ListMembersCommandImpl impl;
|
||||||
|
|
||||||
|
@ -24,10 +24,9 @@ import com.google.inject.Inject;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ls-projects",
|
name = "ls-projects",
|
||||||
description = "List projects visible to the caller",
|
description = "List projects visible to the caller",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class ListProjectsCommand extends SshCommand {
|
public class ListProjectsCommand extends SshCommand {
|
||||||
@Inject @Options public ListProjects impl;
|
@Inject @Options public ListProjects impl;
|
||||||
|
|
||||||
|
@ -42,10 +42,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "ls-user-refs",
|
name = "ls-user-refs",
|
||||||
description = "List refs visible to a specific user",
|
description = "List refs visible to a specific user",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class LsUserRefs extends SshCommand {
|
public class LsUserRefs extends SshCommand {
|
||||||
@Inject private AccountResolver accountResolver;
|
@Inject private AccountResolver accountResolver;
|
||||||
@Inject private OneOffRequestContext requestContext;
|
@Inject private OneOffRequestContext requestContext;
|
||||||
@ -53,21 +52,19 @@ public class LsUserRefs extends SshCommand {
|
|||||||
@Inject private GitRepositoryManager repoManager;
|
@Inject private GitRepositoryManager repoManager;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project",
|
name = "--project",
|
||||||
aliases = {"-p"},
|
aliases = {"-p"},
|
||||||
metaVar = "PROJECT",
|
metaVar = "PROJECT",
|
||||||
required = true,
|
required = true,
|
||||||
usage = "project for which the refs should be listed"
|
usage = "project for which the refs should be listed")
|
||||||
)
|
|
||||||
private ProjectControl projectControl;
|
private ProjectControl projectControl;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--user",
|
name = "--user",
|
||||||
aliases = {"-u"},
|
aliases = {"-u"},
|
||||||
metaVar = "USER",
|
metaVar = "USER",
|
||||||
required = true,
|
required = true,
|
||||||
usage = "user for which the groups should be listed"
|
usage = "user for which the groups should be listed")
|
||||||
)
|
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
@Option(name = "--only-refs-heads", usage = "list only refs under refs/heads")
|
@Option(name = "--only-refs-heads", usage = "list only refs under refs/heads")
|
||||||
|
@ -37,10 +37,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
@CommandMetaData(name = "install", description = "Install/Add a plugin", runsAt = MASTER_OR_SLAVE)
|
@CommandMetaData(name = "install", description = "Install/Add a plugin", runsAt = MASTER_OR_SLAVE)
|
||||||
final class PluginInstallCommand extends SshCommand {
|
final class PluginInstallCommand extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--name",
|
name = "--name",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
usage = "install under name"
|
usage = "install under name")
|
||||||
)
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Option(name = "-")
|
@Option(name = "-")
|
||||||
|
@ -43,9 +43,8 @@ public class Query extends SshCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--all-approvals",
|
name = "--all-approvals",
|
||||||
usage = "Include information about all patch sets and approvals"
|
usage = "Include information about all patch sets and approvals")
|
||||||
)
|
|
||||||
void setApprovals(boolean on) {
|
void setApprovals(boolean on) {
|
||||||
if (on) {
|
if (on) {
|
||||||
processor.setIncludePatchSets(on);
|
processor.setIncludePatchSets(on);
|
||||||
@ -84,21 +83,19 @@ public class Query extends SshCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--start",
|
name = "--start",
|
||||||
aliases = {"-S"},
|
aliases = {"-S"},
|
||||||
usage = "Number of changes to skip"
|
usage = "Number of changes to skip")
|
||||||
)
|
|
||||||
void setStart(int start) {
|
void setStart(int start) {
|
||||||
processor.setStart(start);
|
processor.setStart(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "QUERY",
|
metaVar = "QUERY",
|
||||||
usage = "Query to execute"
|
usage = "Query to execute")
|
||||||
)
|
|
||||||
private List<String> query;
|
private List<String> query;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,9 +46,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
/** Receives change upload over SSH using the Git receive-pack protocol. */
|
/** Receives change upload over SSH using the Git receive-pack protocol. */
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "receive-pack",
|
name = "receive-pack",
|
||||||
description = "Standard Git server side command for client side git push"
|
description = "Standard Git server side command for client side git push")
|
||||||
)
|
|
||||||
final class Receive extends AbstractGitCommand {
|
final class Receive extends AbstractGitCommand {
|
||||||
private static final Logger log = LoggerFactory.getLogger(Receive.class);
|
private static final Logger log = LoggerFactory.getLogger(Receive.class);
|
||||||
|
|
||||||
@ -61,21 +60,19 @@ final class Receive extends AbstractGitCommand {
|
|||||||
MultimapBuilder.hashKeys(2).hashSetValues().build();
|
MultimapBuilder.hashKeys(2).hashSetValues().build();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--reviewer",
|
name = "--reviewer",
|
||||||
aliases = {"--re"},
|
aliases = {"--re"},
|
||||||
metaVar = "EMAIL",
|
metaVar = "EMAIL",
|
||||||
usage = "request reviewer for change(s)"
|
usage = "request reviewer for change(s)")
|
||||||
)
|
|
||||||
void addReviewer(Account.Id id) {
|
void addReviewer(Account.Id id) {
|
||||||
reviewers.put(ReviewerStateInternal.REVIEWER, id);
|
reviewers.put(ReviewerStateInternal.REVIEWER, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--cc",
|
name = "--cc",
|
||||||
aliases = {},
|
aliases = {},
|
||||||
metaVar = "EMAIL",
|
metaVar = "EMAIL",
|
||||||
usage = "CC user on change(s)"
|
usage = "CC user on change(s)")
|
||||||
)
|
|
||||||
void addCC(Account.Id id) {
|
void addCC(Account.Id id) {
|
||||||
reviewers.put(ReviewerStateInternal.CC, id);
|
reviewers.put(ReviewerStateInternal.CC, id);
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,10 @@ import org.kohsuke.args4j.Argument;
|
|||||||
@CommandMetaData(name = "rename-group", description = "Rename an account group")
|
@CommandMetaData(name = "rename-group", description = "Rename an account group")
|
||||||
public class RenameGroupCommand extends SshCommand {
|
public class RenameGroupCommand extends SshCommand {
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "name of the group to be renamed"
|
usage = "name of the group to be renamed")
|
||||||
)
|
|
||||||
private String groupName;
|
private String groupName;
|
||||||
|
|
||||||
@Argument(index = 1, required = true, metaVar = "NEWNAME", usage = "new name of the group")
|
@Argument(index = 1, required = true, metaVar = "NEWNAME", usage = "new name of the group")
|
||||||
|
@ -73,12 +73,11 @@ public class ReviewCommand extends SshCommand {
|
|||||||
private final Set<PatchSet> patchSets = new HashSet<>();
|
private final Set<PatchSet> patchSets = new HashSet<>();
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "{COMMIT | CHANGE,PATCHSET}",
|
metaVar = "{COMMIT | CHANGE,PATCHSET}",
|
||||||
usage = "list of commits or patch sets to review"
|
usage = "list of commits or patch sets to review")
|
||||||
)
|
|
||||||
void addPatchSetId(String token) {
|
void addPatchSetId(String token) {
|
||||||
try {
|
try {
|
||||||
PatchSet ps = psParser.parsePatchSet(token, projectControl, branch);
|
PatchSet ps = psParser.parsePatchSet(token, projectControl, branch);
|
||||||
@ -91,29 +90,26 @@ public class ReviewCommand extends SshCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project",
|
name = "--project",
|
||||||
aliases = "-p",
|
aliases = "-p",
|
||||||
usage = "project containing the specified patch set(s)"
|
usage = "project containing the specified patch set(s)")
|
||||||
)
|
|
||||||
private ProjectControl projectControl;
|
private ProjectControl projectControl;
|
||||||
|
|
||||||
@Option(name = "--branch", aliases = "-b", usage = "branch containing the specified patch set(s)")
|
@Option(name = "--branch", aliases = "-b", usage = "branch containing the specified patch set(s)")
|
||||||
private String branch;
|
private String branch;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--message",
|
name = "--message",
|
||||||
aliases = "-m",
|
aliases = "-m",
|
||||||
usage = "cover message to publish on change(s)",
|
usage = "cover message to publish on change(s)",
|
||||||
metaVar = "MESSAGE"
|
metaVar = "MESSAGE")
|
||||||
)
|
|
||||||
private String changeComment;
|
private String changeComment;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--notify",
|
name = "--notify",
|
||||||
aliases = "-n",
|
aliases = "-n",
|
||||||
usage = "Who to send email notifications to after the review is stored.",
|
usage = "Who to send email notifications to after the review is stored.",
|
||||||
metaVar = "NOTIFYHANDLING"
|
metaVar = "NOTIFYHANDLING")
|
||||||
)
|
|
||||||
private NotifyHandling notify;
|
private NotifyHandling notify;
|
||||||
|
|
||||||
@Option(name = "--abandon", usage = "abandon the specified change(s)")
|
@Option(name = "--abandon", usage = "abandon the specified change(s)")
|
||||||
@ -135,19 +131,17 @@ public class ReviewCommand extends SshCommand {
|
|||||||
private boolean json;
|
private boolean json;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--tag",
|
name = "--tag",
|
||||||
aliases = "-t",
|
aliases = "-t",
|
||||||
usage = "applies a tag to the given review",
|
usage = "applies a tag to the given review",
|
||||||
metaVar = "TAG"
|
metaVar = "TAG")
|
||||||
)
|
|
||||||
private String changeTag;
|
private String changeTag;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--label",
|
name = "--label",
|
||||||
aliases = "-l",
|
aliases = "-l",
|
||||||
usage = "custom label(s) to assign",
|
usage = "custom label(s) to assign",
|
||||||
metaVar = "LABEL=VALUE"
|
metaVar = "LABEL=VALUE")
|
||||||
)
|
|
||||||
void addLabel(String token) {
|
void addLabel(String token) {
|
||||||
LabelVote v = LabelVote.parseWithEquals(token);
|
LabelVote v = LabelVote.parseWithEquals(token);
|
||||||
LabelType.checkName(v.label()); // Disallow SUBM.
|
LabelType.checkName(v.label()); // Disallow SUBM.
|
||||||
|
@ -65,11 +65,10 @@ import org.kohsuke.args4j.Option;
|
|||||||
final class SetAccountCommand extends SshCommand {
|
final class SetAccountCommand extends SshCommand {
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
metaVar = "USER",
|
metaVar = "USER",
|
||||||
usage = "full name, email-address, ssh username or account id"
|
usage = "full name, email-address, ssh username or account id")
|
||||||
)
|
|
||||||
private Account.Id id;
|
private Account.Id id;
|
||||||
|
|
||||||
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
|
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
|
||||||
@ -85,34 +84,30 @@ final class SetAccountCommand extends SshCommand {
|
|||||||
private List<String> addEmails = new ArrayList<>();
|
private List<String> addEmails = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--delete-email",
|
name = "--delete-email",
|
||||||
metaVar = "EMAIL",
|
metaVar = "EMAIL",
|
||||||
usage = "email addresses to delete from the account"
|
usage = "email addresses to delete from the account")
|
||||||
)
|
|
||||||
private List<String> deleteEmails = new ArrayList<>();
|
private List<String> deleteEmails = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--preferred-email",
|
name = "--preferred-email",
|
||||||
metaVar = "EMAIL",
|
metaVar = "EMAIL",
|
||||||
usage = "a registered email address from the account"
|
usage = "a registered email address from the account")
|
||||||
)
|
|
||||||
private String preferredEmail;
|
private String preferredEmail;
|
||||||
|
|
||||||
@Option(name = "--add-ssh-key", metaVar = "-|KEY", usage = "public keys to add to the account")
|
@Option(name = "--add-ssh-key", metaVar = "-|KEY", usage = "public keys to add to the account")
|
||||||
private List<String> addSshKeys = new ArrayList<>();
|
private List<String> addSshKeys = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--delete-ssh-key",
|
name = "--delete-ssh-key",
|
||||||
metaVar = "-|KEY",
|
metaVar = "-|KEY",
|
||||||
usage = "public keys to delete from the account"
|
usage = "public keys to delete from the account")
|
||||||
)
|
|
||||||
private List<String> deleteSshKeys = new ArrayList<>();
|
private List<String> deleteSshKeys = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--http-password",
|
name = "--http-password",
|
||||||
metaVar = "PASSWORD",
|
metaVar = "PASSWORD",
|
||||||
usage = "password for HTTP authentication for the account"
|
usage = "password for HTTP authentication for the account")
|
||||||
)
|
|
||||||
private String httpPassword;
|
private String httpPassword;
|
||||||
|
|
||||||
@Option(name = "--clear-http-password", usage = "clear HTTP password for the account")
|
@Option(name = "--clear-http-password", usage = "clear HTTP password for the account")
|
||||||
|
@ -33,10 +33,9 @@ import org.kohsuke.args4j.Argument;
|
|||||||
|
|
||||||
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "set-level",
|
name = "set-level",
|
||||||
description = "Change the level of loggers",
|
description = "Change the level of loggers",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
public class SetLoggingLevelCommand extends SshCommand {
|
public class SetLoggingLevelCommand extends SshCommand {
|
||||||
private static final String LOG_CONFIGURATION = "log4j.properties";
|
private static final String LOG_CONFIGURATION = "log4j.properties";
|
||||||
private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration";
|
private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration";
|
||||||
|
@ -44,50 +44,44 @@ import org.kohsuke.args4j.Argument;
|
|||||||
import org.kohsuke.args4j.Option;
|
import org.kohsuke.args4j.Option;
|
||||||
|
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "set-members",
|
name = "set-members",
|
||||||
description = "Modify members of specific group or number of groups"
|
description = "Modify members of specific group or number of groups")
|
||||||
)
|
|
||||||
public class SetMembersCommand extends SshCommand {
|
public class SetMembersCommand extends SshCommand {
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--add",
|
name = "--add",
|
||||||
aliases = {"-a"},
|
aliases = {"-a"},
|
||||||
metaVar = "USER",
|
metaVar = "USER",
|
||||||
usage = "users that should be added as group member"
|
usage = "users that should be added as group member")
|
||||||
)
|
|
||||||
private List<Account.Id> accountsToAdd = new ArrayList<>();
|
private List<Account.Id> accountsToAdd = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--remove",
|
name = "--remove",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "USER",
|
metaVar = "USER",
|
||||||
usage = "users that should be removed from the group"
|
usage = "users that should be removed from the group")
|
||||||
)
|
|
||||||
private List<Account.Id> accountsToRemove = new ArrayList<>();
|
private List<Account.Id> accountsToRemove = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--include",
|
name = "--include",
|
||||||
aliases = {"-i"},
|
aliases = {"-i"},
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "group that should be included as group member"
|
usage = "group that should be included as group member")
|
||||||
)
|
|
||||||
private List<AccountGroup.UUID> groupsToInclude = new ArrayList<>();
|
private List<AccountGroup.UUID> groupsToInclude = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--exclude",
|
name = "--exclude",
|
||||||
aliases = {"-e"},
|
aliases = {"-e"},
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "group that should be excluded from the group"
|
usage = "group that should be excluded from the group")
|
||||||
)
|
|
||||||
private List<AccountGroup.UUID> groupsToRemove = new ArrayList<>();
|
private List<AccountGroup.UUID> groupsToRemove = new ArrayList<>();
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "GROUP",
|
metaVar = "GROUP",
|
||||||
usage = "groups to modify"
|
usage = "groups to modify")
|
||||||
)
|
|
||||||
private List<AccountGroup.UUID> groups = new ArrayList<>();
|
private List<AccountGroup.UUID> groups = new ArrayList<>();
|
||||||
|
|
||||||
@Inject private AddMembers addMembers;
|
@Inject private AddMembers addMembers;
|
||||||
|
@ -35,18 +35,16 @@ final class SetProjectCommand extends SshCommand {
|
|||||||
private ProjectControl projectControl;
|
private ProjectControl projectControl;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--description",
|
name = "--description",
|
||||||
aliases = {"-d"},
|
aliases = {"-d"},
|
||||||
metaVar = "DESCRIPTION",
|
metaVar = "DESCRIPTION",
|
||||||
usage = "description of project"
|
usage = "description of project")
|
||||||
)
|
|
||||||
private String projectDescription;
|
private String projectDescription;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--submit-type",
|
name = "--submit-type",
|
||||||
aliases = {"-t"},
|
aliases = {"-t"},
|
||||||
usage = "project submit type\n(default: MERGE_IF_NECESSARY)"
|
usage = "project submit type\n(default: MERGE_IF_NECESSARY)")
|
||||||
)
|
|
||||||
private SubmitType submitType;
|
private SubmitType submitType;
|
||||||
|
|
||||||
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
|
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
|
||||||
@ -62,37 +60,33 @@ final class SetProjectCommand extends SshCommand {
|
|||||||
private InheritableBoolean requireChangeID;
|
private InheritableBoolean requireChangeID;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--use-contributor-agreements",
|
name = "--use-contributor-agreements",
|
||||||
aliases = {"--ca"},
|
aliases = {"--ca"},
|
||||||
usage = "if contributor agreement is required"
|
usage = "if contributor agreement is required")
|
||||||
)
|
|
||||||
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
||||||
contributorAgreements = InheritableBoolean.TRUE;
|
contributorAgreements = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-contributor-agreements",
|
name = "--no-contributor-agreements",
|
||||||
aliases = {"--nca"},
|
aliases = {"--nca"},
|
||||||
usage = "if contributor agreement is not required"
|
usage = "if contributor agreement is not required")
|
||||||
)
|
|
||||||
void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) {
|
||||||
contributorAgreements = InheritableBoolean.FALSE;
|
contributorAgreements = InheritableBoolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--use-signed-off-by",
|
name = "--use-signed-off-by",
|
||||||
aliases = {"--so"},
|
aliases = {"--so"},
|
||||||
usage = "if signed-off-by is required"
|
usage = "if signed-off-by is required")
|
||||||
)
|
|
||||||
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
||||||
signedOffBy = InheritableBoolean.TRUE;
|
signedOffBy = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-signed-off-by",
|
name = "--no-signed-off-by",
|
||||||
aliases = {"--nso"},
|
aliases = {"--nso"},
|
||||||
usage = "if signed-off-by is not required"
|
usage = "if signed-off-by is not required")
|
||||||
)
|
|
||||||
void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) {
|
||||||
signedOffBy = InheritableBoolean.FALSE;
|
signedOffBy = InheritableBoolean.FALSE;
|
||||||
}
|
}
|
||||||
@ -103,36 +97,32 @@ final class SetProjectCommand extends SshCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-content-merge",
|
name = "--no-content-merge",
|
||||||
usage = "don't allow automatic conflict resolving within files"
|
usage = "don't allow automatic conflict resolving within files")
|
||||||
)
|
|
||||||
void setNoContentMerge(@SuppressWarnings("unused") boolean on) {
|
void setNoContentMerge(@SuppressWarnings("unused") boolean on) {
|
||||||
contentMerge = InheritableBoolean.FALSE;
|
contentMerge = InheritableBoolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--require-change-id",
|
name = "--require-change-id",
|
||||||
aliases = {"--id"},
|
aliases = {"--id"},
|
||||||
usage = "if change-id is required"
|
usage = "if change-id is required")
|
||||||
)
|
|
||||||
void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
|
void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
|
||||||
requireChangeID = InheritableBoolean.TRUE;
|
requireChangeID = InheritableBoolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--no-change-id",
|
name = "--no-change-id",
|
||||||
aliases = {"--nid"},
|
aliases = {"--nid"},
|
||||||
usage = "if change-id is not required"
|
usage = "if change-id is not required")
|
||||||
)
|
|
||||||
void setNoChangeId(@SuppressWarnings("unused") boolean on) {
|
void setNoChangeId(@SuppressWarnings("unused") boolean on) {
|
||||||
requireChangeID = InheritableBoolean.FALSE;
|
requireChangeID = InheritableBoolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--project-state",
|
name = "--project-state",
|
||||||
aliases = {"--ps"},
|
aliases = {"--ps"},
|
||||||
usage = "project's visibility state"
|
usage = "project's visibility state")
|
||||||
)
|
|
||||||
private ProjectState state;
|
private ProjectState state;
|
||||||
|
|
||||||
@Option(name = "--max-object-size-limit", usage = "max Git object size for this project")
|
@Option(name = "--max-object-size-limit", usage = "max Git object size for this project")
|
||||||
|
@ -49,30 +49,27 @@ public class SetReviewersCommand extends SshCommand {
|
|||||||
private ProjectControl projectControl;
|
private ProjectControl projectControl;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--add",
|
name = "--add",
|
||||||
aliases = {"-a"},
|
aliases = {"-a"},
|
||||||
metaVar = "REVIEWER",
|
metaVar = "REVIEWER",
|
||||||
usage = "user or group that should be added as reviewer"
|
usage = "user or group that should be added as reviewer")
|
||||||
)
|
|
||||||
private List<String> toAdd = new ArrayList<>();
|
private List<String> toAdd = new ArrayList<>();
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--remove",
|
name = "--remove",
|
||||||
aliases = {"-r"},
|
aliases = {"-r"},
|
||||||
metaVar = "REVIEWER",
|
metaVar = "REVIEWER",
|
||||||
usage = "user that should be removed from the reviewer list"
|
usage = "user that should be removed from the reviewer list")
|
||||||
)
|
|
||||||
void optionRemove(Account.Id who) {
|
void optionRemove(Account.Id who) {
|
||||||
toRemove.add(who);
|
toRemove.add(who);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 0,
|
index = 0,
|
||||||
required = true,
|
required = true,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
metaVar = "CHANGE",
|
metaVar = "CHANGE",
|
||||||
usage = "changes to modify"
|
usage = "changes to modify")
|
||||||
)
|
|
||||||
void addChange(String token) {
|
void addChange(String token) {
|
||||||
try {
|
try {
|
||||||
changeArgumentParser.addChange(token, changes, projectControl);
|
changeArgumentParser.addChange(token, changes, projectControl);
|
||||||
|
@ -57,10 +57,9 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Show the current cache states. */
|
/** Show the current cache states. */
|
||||||
@RequiresAnyCapability({VIEW_CACHES, MAINTAIN_SERVER})
|
@RequiresAnyCapability({VIEW_CACHES, MAINTAIN_SERVER})
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "show-caches",
|
name = "show-caches",
|
||||||
description = "Display current cache statistics",
|
description = "Display current cache statistics",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class ShowCaches extends SshCommand {
|
final class ShowCaches extends SshCommand {
|
||||||
private static volatile long serverStarted;
|
private static volatile long serverStarted;
|
||||||
|
|
||||||
@ -90,11 +89,10 @@ final class ShowCaches extends SshCommand {
|
|||||||
@Inject private PermissionBackend permissionBackend;
|
@Inject private PermissionBackend permissionBackend;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--width",
|
name = "--width",
|
||||||
aliases = {"-w"},
|
aliases = {"-w"},
|
||||||
metaVar = "COLS",
|
metaVar = "COLS",
|
||||||
usage = "width of output table"
|
usage = "width of output table")
|
||||||
)
|
|
||||||
private int columns = 80;
|
private int columns = 80;
|
||||||
|
|
||||||
private int nw;
|
private int nw;
|
||||||
|
@ -50,23 +50,20 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Show the current SSH connections. */
|
/** Show the current SSH connections. */
|
||||||
@RequiresCapability(GlobalCapability.VIEW_CONNECTIONS)
|
@RequiresCapability(GlobalCapability.VIEW_CONNECTIONS)
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "show-connections",
|
name = "show-connections",
|
||||||
description = "Display active client SSH connections",
|
description = "Display active client SSH connections",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class ShowConnections extends SshCommand {
|
final class ShowConnections extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--numeric",
|
name = "--numeric",
|
||||||
aliases = {"-n"},
|
aliases = {"-n"},
|
||||||
usage = "don't resolve names"
|
usage = "don't resolve names")
|
||||||
)
|
|
||||||
private boolean numeric;
|
private boolean numeric;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--wide",
|
name = "--wide",
|
||||||
aliases = {"-w"},
|
aliases = {"-w"},
|
||||||
usage = "display without line width truncation"
|
usage = "display without line width truncation")
|
||||||
)
|
|
||||||
private boolean wide;
|
private boolean wide;
|
||||||
|
|
||||||
@Inject private SshDaemon daemon;
|
@Inject private SshDaemon daemon;
|
||||||
|
@ -45,23 +45,20 @@ import org.kohsuke.args4j.Option;
|
|||||||
/** Display the current work queue. */
|
/** Display the current work queue. */
|
||||||
@AdminHighPriorityCommand
|
@AdminHighPriorityCommand
|
||||||
@CommandMetaData(
|
@CommandMetaData(
|
||||||
name = "show-queue",
|
name = "show-queue",
|
||||||
description = "Display the background work queues",
|
description = "Display the background work queues",
|
||||||
runsAt = MASTER_OR_SLAVE
|
runsAt = MASTER_OR_SLAVE)
|
||||||
)
|
|
||||||
final class ShowQueue extends SshCommand {
|
final class ShowQueue extends SshCommand {
|
||||||
@Option(
|
@Option(
|
||||||
name = "--wide",
|
name = "--wide",
|
||||||
aliases = {"-w"},
|
aliases = {"-w"},
|
||||||
usage = "display without line width truncation"
|
usage = "display without line width truncation")
|
||||||
)
|
|
||||||
private boolean wide;
|
private boolean wide;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--by-queue",
|
name = "--by-queue",
|
||||||
aliases = {"-q"},
|
aliases = {"-q"},
|
||||||
usage = "group tasks by queue and print queue info"
|
usage = "group tasks by queue and print queue info")
|
||||||
)
|
|
||||||
private boolean groupByQueue;
|
private boolean groupByQueue;
|
||||||
|
|
||||||
@Inject private PermissionBackend permissionBackend;
|
@Inject private PermissionBackend permissionBackend;
|
||||||
|
@ -60,11 +60,10 @@ final class StreamEvents extends BaseCommand {
|
|||||||
private static final int BATCH_SIZE = 32;
|
private static final int BATCH_SIZE = 32;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "--subscribe",
|
name = "--subscribe",
|
||||||
aliases = {"-s"},
|
aliases = {"-s"},
|
||||||
metaVar = "SUBSCRIBE",
|
metaVar = "SUBSCRIBE",
|
||||||
usage = "subscribe to specific stream-events"
|
usage = "subscribe to specific stream-events")
|
||||||
)
|
|
||||||
private List<String> subscribedToEvents = new ArrayList<>();
|
private List<String> subscribedToEvents = new ArrayList<>();
|
||||||
|
|
||||||
@Inject private IdentifiedUser currentUser;
|
@Inject private IdentifiedUser currentUser;
|
||||||
|
@ -56,15 +56,14 @@ public class UploadArchive extends AbstractGitCommand {
|
|||||||
*/
|
*/
|
||||||
static class Options {
|
static class Options {
|
||||||
@Option(
|
@Option(
|
||||||
name = "-f",
|
name = "-f",
|
||||||
aliases = {"--format"},
|
aliases = {"--format"},
|
||||||
usage =
|
usage =
|
||||||
"Format of the"
|
"Format of the"
|
||||||
+ " resulting archive: tar or zip... If this option is not given, and"
|
+ " resulting archive: tar or zip... If this option is not given, and"
|
||||||
+ " the output file is specified, the format is inferred from the"
|
+ " the output file is specified, the format is inferred from the"
|
||||||
+ " filename if possible (e.g. writing to \"foo.zip\" makes the output"
|
+ " filename if possible (e.g. writing to \"foo.zip\" makes the output"
|
||||||
+ " to be in the zip format). Otherwise the output format is tar."
|
+ " to be in the zip format). Otherwise the output format is tar.")
|
||||||
)
|
|
||||||
private String format = "tar";
|
private String format = "tar";
|
||||||
|
|
||||||
@Option(name = "--prefix", usage = "Prepend <prefix>/ to each filename in the archive.")
|
@Option(name = "--prefix", usage = "Prepend <prefix>/ to each filename in the archive.")
|
||||||
@ -98,25 +97,23 @@ public class UploadArchive extends AbstractGitCommand {
|
|||||||
private boolean level8;
|
private boolean level8;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = "-9",
|
name = "-9",
|
||||||
usage =
|
usage =
|
||||||
"Highest and slowest compression level. You "
|
"Highest and slowest compression level. You "
|
||||||
+ "can specify any number from 1 to 9 to adjust compression speed and "
|
+ "can specify any number from 1 to 9 to adjust compression speed and "
|
||||||
+ "ratio."
|
+ "ratio.")
|
||||||
)
|
|
||||||
private boolean level9;
|
private boolean level9;
|
||||||
|
|
||||||
@Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.")
|
@Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.")
|
||||||
private String treeIsh = "master";
|
private String treeIsh = "master";
|
||||||
|
|
||||||
@Argument(
|
@Argument(
|
||||||
index = 1,
|
index = 1,
|
||||||
multiValued = true,
|
multiValued = true,
|
||||||
usage =
|
usage =
|
||||||
"Without an optional path parameter, all files and subdirectories of "
|
"Without an optional path parameter, all files and subdirectories of "
|
||||||
+ "the current working directory are included in the archive. If one "
|
+ "the current working directory are included in the archive. If one "
|
||||||
+ "or more paths are specified, only these are included."
|
+ "or more paths are specified, only these are included.")
|
||||||
)
|
|
||||||
private List<String> path;
|
private List<String> path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user