Merge branch 'stable-2.13'
* stable-2.13: Fix rendering of block in documentation of init program Cleanups in gen_licenses.py Init: Accept -b as an alias of --batch Improve documentation of init program AccountManager: Include identity key in exception messages Improve formatting in gitweb documentation Set version to 2.13-rc1 Change-Id: I7eb67b29ea1f6ab31f2357dbd53898048ea4a07c
This commit is contained in:
		@@ -1961,16 +1961,16 @@ Path to the locally installed `gitweb.cgi` executable.  This CGI will
 | 
				
			|||||||
be called by Gerrit Code Review when the URL `/gitweb` is accessed.
 | 
					be called by Gerrit Code Review when the URL `/gitweb` is accessed.
 | 
				
			||||||
Project level access controls are enforced prior to calling the CGI.
 | 
					Project level access controls are enforced prior to calling the CGI.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
 | 
					Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[gitweb.url]]gitweb.url::
 | 
					[[gitweb.url]]gitweb.url::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional URL of an affiliated gitweb service.  Defines the
 | 
					Optional URL of an affiliated gitweb service.  Defines the
 | 
				
			||||||
web location where a `gitweb.cgi` is installed to browse
 | 
					web location where a `gitweb.cgi` is installed to browse
 | 
				
			||||||
gerrit.basePath and the repositories it contains.
 | 
					`gerrit.basePath` and the repositories it contains.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Gerrit appends any necessary query arguments onto the end of this URL.
 | 
					Gerrit appends any necessary query arguments onto the end of this URL.
 | 
				
			||||||
For example, "?p=$project.git;h=$commit".
 | 
					For example, `?p=$project.git;h=$commit`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[gitweb.type]]gitweb.type::
 | 
					[[gitweb.type]]gitweb.type::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
@@ -1985,7 +1985,7 @@ support.
 | 
				
			|||||||
[[gitweb.revision]]gitweb.revision::
 | 
					[[gitweb.revision]]gitweb.revision::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at a specific commit when `custom` is used above.
 | 
					at a specific commit when `gitweb.type` is set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit
 | 
					Valid replacements are `${project}` for the project name in Gerrit
 | 
				
			||||||
and `${commit}` for the SHA1 hash for the commit.
 | 
					and `${commit}` for the SHA1 hash for the commit.
 | 
				
			||||||
@@ -1993,14 +1993,14 @@ and `${commit}` for the SHA1 hash for the commit.
 | 
				
			|||||||
[[gitweb.project]]gitweb.project::
 | 
					[[gitweb.project]]gitweb.project::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at a specific project when `custom` is used above.
 | 
					at a specific project when `gitweb.type` is set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit.
 | 
					Valid replacements are `${project}` for the project name in Gerrit.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[gitweb.branch]]gitweb.branch::
 | 
					[[gitweb.branch]]gitweb.branch::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at a specific branch when `custom` is used above.
 | 
					at a specific branch when `gitweb.type` is set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit
 | 
					Valid replacements are `${project}` for the project name in Gerrit
 | 
				
			||||||
and `${branch}` for the name of the branch.
 | 
					and `${branch}` for the name of the branch.
 | 
				
			||||||
@@ -2008,8 +2008,8 @@ and `${branch}` for the name of the branch.
 | 
				
			|||||||
[[gitweb.roottree]]gitweb.roottree::
 | 
					[[gitweb.roottree]]gitweb.roottree::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at the contents of the root tree in a specific commit when `custom` is
 | 
					at the contents of the root tree in a specific commit when `gitweb.type`
 | 
				
			||||||
used above.
 | 
					is set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit
 | 
					Valid replacements are `${project}` for the project name in Gerrit
 | 
				
			||||||
and `${commit}` for the SHA1 hash for the commit.
 | 
					and `${commit}` for the SHA1 hash for the commit.
 | 
				
			||||||
@@ -2017,8 +2017,8 @@ and `${commit}` for the SHA1 hash for the commit.
 | 
				
			|||||||
[[gitweb.file]]gitweb.file::
 | 
					[[gitweb.file]]gitweb.file::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at the contents of a file in a specific commit when `custom` is used
 | 
					at the contents of a file in a specific commit when `gitweb.type` is
 | 
				
			||||||
above.
 | 
					set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit,
 | 
					Valid replacements are `${project}` for the project name in Gerrit,
 | 
				
			||||||
`${file}` for the file name and `${commit}` for the SHA1 hash for
 | 
					`${file}` for the file name and `${commit}` for the SHA1 hash for
 | 
				
			||||||
@@ -2027,8 +2027,8 @@ the commit.
 | 
				
			|||||||
[[gitweb.filehistory]]gitweb.filehistory::
 | 
					[[gitweb.filehistory]]gitweb.filehistory::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Optional pattern to use for constructing the gitweb URL when pointing
 | 
					Optional pattern to use for constructing the gitweb URL when pointing
 | 
				
			||||||
at the history of a file in a specific branch when `custom` is used
 | 
					at the history of a file in a specific branch when when `gitweb.type`
 | 
				
			||||||
above.
 | 
					is set to `custom`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid replacements are `${project}` for the project name in Gerrit,
 | 
					Valid replacements are `${project}` for the project name in Gerrit,
 | 
				
			||||||
`${file}` for the file name and `${branch}` for the name of the
 | 
					`${file}` for the file name and `${branch}` for the name of the
 | 
				
			||||||
@@ -2039,7 +2039,7 @@ branch.
 | 
				
			|||||||
Optional setting for modifying the link name presented to the user
 | 
					Optional setting for modifying the link name presented to the user
 | 
				
			||||||
in the Gerrit web-UI.
 | 
					in the Gerrit web-UI.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Default linkname for custom type is "gitweb".
 | 
					The default linkname for custom type is `gitweb`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[gitweb.pathSeparator]]gitweb.pathSeparator::
 | 
					[[gitweb.pathSeparator]]gitweb.pathSeparator::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
@@ -2054,9 +2054,9 @@ Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
 | 
				
			|||||||
allow using an alternative path separator character. In Gitblit, this can be
 | 
					allow using an alternative path separator character. In Gitblit, this can be
 | 
				
			||||||
configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
 | 
					configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
 | 
				
			||||||
In Gerrit, the alternative path separator can be configured correspondingly
 | 
					In Gerrit, the alternative path separator can be configured correspondingly
 | 
				
			||||||
using the property 'gitweb.pathSeparator'.
 | 
					using the property `gitweb.pathSeparator`.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid values are the characters '*', '(' and ')'.
 | 
					Valid values are the characters `*`, `(` and `)`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[gitweb.urlEncode]]gitweb.urlEncode::
 | 
					[[gitweb.urlEncode]]gitweb.urlEncode::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
@@ -2064,12 +2064,12 @@ Whether or not Gerrit should encode the generated viewer URL.
 | 
				
			|||||||
+
 | 
					+
 | 
				
			||||||
Gerrit composes the viewer URL using information about the project, branch, file
 | 
					Gerrit composes the viewer URL using information about the project, branch, file
 | 
				
			||||||
or commit of the target object to be displayed. Typically viewers such as CGit
 | 
					or commit of the target object to be displayed. Typically viewers such as CGit
 | 
				
			||||||
and gitweb do need those parts to be encoded, including the '/' in project's name,
 | 
					and gitweb do need those parts to be encoded, including the `/` in project's name,
 | 
				
			||||||
for being correctly parsed.
 | 
					for being correctly parsed.
 | 
				
			||||||
However other viewers could instead require an unencoded URL (e.g. GitHub web
 | 
					However other viewers could instead require an unencoded URL (e.g. GitHub web
 | 
				
			||||||
based viewer)
 | 
					based viewer).
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
Valid values are "true" and "false," default is "true."
 | 
					Valid values are `true` and `false`. The default is `true`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[groups]]
 | 
					[[groups]]
 | 
				
			||||||
=== Section groups
 | 
					=== Section groups
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
= init
 | 
					= init
 | 
				
			||||||
 | 
					
 | 
				
			||||||
== NAME
 | 
					== NAME
 | 
				
			||||||
init - Initialize/Upgrade a Gerrit server installation
 | 
					init - Initialize a new Gerrit server installation or upgrade an existing
 | 
				
			||||||
 | 
					installation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
== SYNOPSIS
 | 
					== SYNOPSIS
 | 
				
			||||||
[verse]
 | 
					[verse]
 | 
				
			||||||
@@ -25,20 +26,21 @@ Creates a new Gerrit server installation, interactively prompting
 | 
				
			|||||||
for some basic setup prior to writing default configuration files
 | 
					for some basic setup prior to writing default configuration files
 | 
				
			||||||
into a newly created `$site_path`.
 | 
					into a newly created `$site_path`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If run in an existing `$site_path`, init will upgrade some resources
 | 
					If run in an existing `$site_path`, init upgrades existing resources
 | 
				
			||||||
(e.g. DB schema, plugins) as necessary.
 | 
					(e.g. DB schema, plugins) as necessary.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
== OPTIONS
 | 
					== OPTIONS
 | 
				
			||||||
 | 
					-b::
 | 
				
			||||||
--batch::
 | 
					--batch::
 | 
				
			||||||
	Run in batch mode, skipping interactive prompts. For a fresh
 | 
						Run in batch mode, skipping interactive prompts. For a fresh
 | 
				
			||||||
	install, reasonable configuration defaults are chosen based
 | 
						install, reasonable configuration defaults are chosen based
 | 
				
			||||||
	on the whims of the Gerrit developers. On upgrades, the settings
 | 
						on the whims of the Gerrit developers. On upgrades, the existing
 | 
				
			||||||
	in gerrit.config are respected.
 | 
						settings in `gerrit.config` are respected.
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
	If during a schema migration unused objects (e.g. tables, columns)
 | 
					If during a schema migration unused objects (e.g. tables, columns)
 | 
				
			||||||
	are detected they are *not* automatically dropped, but only a list of
 | 
					are detected, they are *not* automatically dropped; a list of SQL
 | 
				
			||||||
	SQL statements to drop these objects is provided. To drop the unused
 | 
					statements to drop these objects is provided. To drop the unused
 | 
				
			||||||
	objects these SQL statements have to be executed manually.
 | 
					objects these SQL statements must be executed manually.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--no-auto-start::
 | 
					--no-auto-start::
 | 
				
			||||||
	Don't automatically start the daemon after initializing a
 | 
						Don't automatically start the daemon after initializing a
 | 
				
			||||||
@@ -48,7 +50,7 @@ If run in an existing `$site_path`, init will upgrade some resources
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-d::
 | 
					-d::
 | 
				
			||||||
--site-path::
 | 
					--site-path::
 | 
				
			||||||
	Location of the gerrit.config file, and all other per-site
 | 
						Location of the `gerrit.config` file, and all other per-site
 | 
				
			||||||
	configuration data, supporting libraries and log files.
 | 
						configuration data, supporting libraries and log files.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--skip-plugins::
 | 
					--skip-plugins::
 | 
				
			||||||
@@ -56,7 +58,7 @@ If run in an existing `$site_path`, init will upgrade some resources
 | 
				
			|||||||
	is needed when initializing a gerrit site without an archive. That
 | 
						is needed when initializing a gerrit site without an archive. That
 | 
				
			||||||
	happens when running gerrit acceptance or integration tests in a
 | 
						happens when running gerrit acceptance or integration tests in a
 | 
				
			||||||
	debugger, using classes. Supplying this option leads to ignoring the
 | 
						debugger, using classes. Supplying this option leads to ignoring the
 | 
				
			||||||
	--install-plugin and --install-all-plugins options, if supplied as well.
 | 
						`--install-plugin` and `--install-all-plugins` options, if supplied as well.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--list-plugins::
 | 
					--list-plugins::
 | 
				
			||||||
	Print names of plugins that can be installed during init process.
 | 
						Print names of plugins that can be installed during init process.
 | 
				
			||||||
@@ -64,19 +66,19 @@ If run in an existing `$site_path`, init will upgrade some resources
 | 
				
			|||||||
--install-all-plugins::
 | 
					--install-all-plugins::
 | 
				
			||||||
	Automatically install all plugins from gerrit.war without asking.
 | 
						Automatically install all plugins from gerrit.war without asking.
 | 
				
			||||||
	This option also works in batch mode. This option cannot be supplied
 | 
						This option also works in batch mode. This option cannot be supplied
 | 
				
			||||||
	alongside --install-plugin.
 | 
						alongside `--install-plugin`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--secure-store-lib::
 | 
					--secure-store-lib::
 | 
				
			||||||
	Path to the jar providing the chosen
 | 
						Path to the jar providing the chosen
 | 
				
			||||||
	link:dev-plugins.html#secure-store[SecureStore] implementation class.
 | 
						link:dev-plugins.html#secure-store[SecureStore] implementation class.
 | 
				
			||||||
	This option is used the same way as the --new-secure-store-lib option
 | 
						This option is used in the same way as the `--new-secure-store-lib` option
 | 
				
			||||||
	documented in link:pgm-SwitchSecureStore.html[SwitchSecureStore].
 | 
						documented in link:pgm-SwitchSecureStore.html[SwitchSecureStore].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--install-plugin::
 | 
					--install-plugin::
 | 
				
			||||||
	Automatically install plugin with given name without asking.
 | 
						Automatically install plugin with given name without asking.
 | 
				
			||||||
	This option also works in batch mode. This option may be supplied
 | 
						This option also works in batch mode. This option may be supplied
 | 
				
			||||||
	more than once to install multiple plugins. This option cannot be
 | 
						more than once to install multiple plugins. This option cannot be
 | 
				
			||||||
	supplied alongside --install-all-plugins.
 | 
						supplied alongside `--install-all-plugins`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--dev::
 | 
					--dev::
 | 
				
			||||||
	Install in developer mode. Default configuration settings are
 | 
						Install in developer mode. Default configuration settings are
 | 
				
			||||||
@@ -84,11 +86,13 @@ If run in an existing `$site_path`, init will upgrade some resources
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
--skip-all-downloads::
 | 
					--skip-all-downloads::
 | 
				
			||||||
	Do not automatically download and install required libraries. The
 | 
						Do not automatically download and install required libraries. The
 | 
				
			||||||
	administrator must provision the required libraries in the lib/ folder.
 | 
						administrator must manually install the required libraries in the `lib/`
 | 
				
			||||||
 | 
						folder.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--skip-download::
 | 
					--skip-download::
 | 
				
			||||||
	Do not automatically download and install the library with the given name.
 | 
						Do not automatically download and install the library with the given name.
 | 
				
			||||||
	The administrator must provision the required library in the lib/ folder.
 | 
						The administrator must manually install the required library in the `lib/`
 | 
				
			||||||
 | 
						folder.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
== CONTEXT
 | 
					== CONTEXT
 | 
				
			||||||
This command can only be run on a server which has direct
 | 
					This command can only be run on a server which has direct
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,8 @@ import java.util.List;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/** Initialize a new Gerrit installation. */
 | 
					/** Initialize a new Gerrit installation. */
 | 
				
			||||||
public class Init extends BaseInit {
 | 
					public class Init extends BaseInit {
 | 
				
			||||||
  @Option(name = "--batch", usage = "Batch mode; skip interactive prompting")
 | 
					  @Option(name = "--batch", aliases = {"-b"},
 | 
				
			||||||
 | 
					      usage = "Batch mode; skip interactive prompting")
 | 
				
			||||||
  private boolean batchMode;
 | 
					  private boolean batchMode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @Option(name = "--no-auto-start", usage = "Don't automatically start daemon after init")
 | 
					  @Option(name = "--no-auto-start", usage = "Don't automatically start daemon after init")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -461,7 +461,8 @@ public class AccountManager {
 | 
				
			|||||||
      AccountExternalId extId = getAccountExternalId(db, key);
 | 
					      AccountExternalId extId = getAccountExternalId(db, key);
 | 
				
			||||||
      if (extId != null) {
 | 
					      if (extId != null) {
 | 
				
			||||||
        if (!extId.getAccountId().equals(from)) {
 | 
					        if (!extId.getAccountId().equals(from)) {
 | 
				
			||||||
          throw new AccountException("Identity in use by another account");
 | 
					          throw new AccountException(
 | 
				
			||||||
 | 
					              "Identity '" + key.get() + "' in use by another account");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        db.accountExternalIds().delete(Collections.singleton(extId));
 | 
					        db.accountExternalIds().delete(Collections.singleton(extId));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -477,7 +478,7 @@ public class AccountManager {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        throw new AccountException("Identity not found");
 | 
					        throw new AccountException("Identity '" + key.get() + "' not found");
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return new AuthResult(from, key, false);
 | 
					      return new AuthResult(from, key, false);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user