From d635d04a3e703724af0b9ec314b31219c7c7dec9 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Tue, 21 Jul 2015 15:42:04 +0200 Subject: [PATCH] Remove deprecated --name option from create project SSH command The name for the new project should be specified as argument and not as option. The --name option is deprecated at least since Gerrit 2.4. It's time to remove it. Change-Id: I77f7c8fe31c20d25e2cfd590c8c74772e4b76488 Signed-off-by: Edwin Kempin --- Documentation/cmd-create-project.txt | 7 +------ .../sshd/commands/CreateProjectCommand.java | 19 +------------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/Documentation/cmd-create-project.txt b/Documentation/cmd-create-project.txt index 31b4538075..d1108b593b 100644 --- a/Documentation/cmd-create-project.txt +++ b/Documentation/cmd-create-project.txt @@ -21,7 +21,7 @@ gerrit create-project - Create a new hosted project [--empty-commit] [--max-object-size-limit ] [--plugin-config ...] - { | --name } + { } -- == DESCRIPTION @@ -49,11 +49,6 @@ This command is intended to be used in scripts. Required; name of the new project to create. If name ends with `.git` the suffix will be automatically removed. ---name:: --n:: - Deprecated alias for the argument. This option may - be removed in a future release. - --branch:: -b:: Name of the initial branch(es) in the newly created project. diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java index 7dc558ee4e..3ad5156838 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/CreateProjectCommand.java @@ -46,15 +46,6 @@ import java.util.Map; @RequiresCapability(GlobalCapability.CREATE_PROJECT) @CommandMetaData(name = "create-project", description = "Create a new project and associated Git repository") final class CreateProjectCommand extends SshCommand { - @Option(name = "--name", aliases = {"-n"}, metaVar = "NAME", usage = "name of project to be created (deprecated option)") - void setProjectNameFromOption(String name) { - if (projectName != null) { - throw new IllegalArgumentException("NAME already supplied"); - } else { - projectName = name; - } - } - @Option(name = "--suggest-parents", aliases = {"-S"}, usage = "suggest parent candidates, " + "if this option is used all other options and arguments are ignored") private boolean suggestParent; @@ -129,16 +120,8 @@ final class CreateProjectCommand extends SshCommand { usage = "plugin configuration parameter with format '.='") private List pluginConfigValues; - private String projectName; - @Argument(index = 0, metaVar = "NAME", usage = "name of project to be created") - void setProjectNameFromArgument(String name) { - if (projectName != null) { - throw new IllegalArgumentException("--name already supplied"); - } else { - projectName = name; - } - } + private String projectName; @Inject private GerritApi gApi;