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 <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-21 15:42:04 +02:00
parent 68532caf30
commit d635d04a3e
2 changed files with 2 additions and 24 deletions

View File

@@ -21,7 +21,7 @@ gerrit create-project - Create a new hosted project
[--empty-commit] [--empty-commit]
[--max-object-size-limit <N>] [--max-object-size-limit <N>]
[--plugin-config <PARAM> ...] [--plugin-config <PARAM> ...]
{ <NAME> | --name <NAME> } { <NAME> }
-- --
== DESCRIPTION == 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 Required; name of the new project to create. If name ends
with `.git` the suffix will be automatically removed. with `.git` the suffix will be automatically removed.
--name::
-n::
Deprecated alias for the <NAME> argument. This option may
be removed in a future release.
--branch:: --branch::
-b:: -b::
Name of the initial branch(es) in the newly created project. Name of the initial branch(es) in the newly created project.

View File

@@ -46,15 +46,6 @@ import java.util.Map;
@RequiresCapability(GlobalCapability.CREATE_PROJECT) @RequiresCapability(GlobalCapability.CREATE_PROJECT)
@CommandMetaData(name = "create-project", description = "Create a new project and associated Git repository") @CommandMetaData(name = "create-project", description = "Create a new project and associated Git repository")
final class CreateProjectCommand extends SshCommand { 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, " @Option(name = "--suggest-parents", aliases = {"-S"}, usage = "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;
@@ -129,16 +120,8 @@ final class CreateProjectCommand extends SshCommand {
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;
private String projectName;
@Argument(index = 0, metaVar = "NAME", usage = "name of project to be created") @Argument(index = 0, metaVar = "NAME", usage = "name of project to be created")
void setProjectNameFromArgument(String name) { private String projectName;
if (projectName != null) {
throw new IllegalArgumentException("--name already supplied");
} else {
projectName = name;
}
}
@Inject @Inject
private GerritApi gApi; private GerritApi gApi;