Support wildcard matching in repository configuration

Per repository configuration was only supporting "*" as the repository
name so it was only possible to configure one default submit type and
same owner groups for all the new repositories.

[repository "*"]
  ownerGroup = Registered Users
  defaultSubmitType = MERGE_IF_NECESSARY

Now supports different repository configuration based on the name. The
only matching patterns supported are exact match or wildcard matching
which can be specified by ending the name by a *. Obviously, repository
name "*" still represents all repositories.

If a project matches more than one repository configuration, then the
configuration from the more precise match will be used. In the following
example, the default submit type for a project named project/plugins/a
would be CHERRY_PICK.

[repository "project/*"]
  defaultSubmitType = MERGE_IF_NECESSARY
[repository "project/plugins/*"]
  defaultSubmitType = CHERRY_PICK

Change-Id: I8b9c157f60a3ad1c6f542cef62e5de8fe9333126
This commit is contained in:
Hugo Arès
2014-11-25 15:33:42 -05:00
parent aeb86c3145
commit 7d2b942df7
10 changed files with 282 additions and 66 deletions

View File

@@ -30,7 +30,8 @@ public class GitReceivePackGroupsProvider extends GroupSetProvider {
@GerritServerConfig Config config,
ThreadLocalRequestContext threadContext,
ServerRequestContext serverCtx) {
super(gb, config, threadContext, serverCtx, "receive", null, "allowGroup");
super(gb, threadContext, serverCtx, config.getStringList("receive", null,
"allowGroup"));
// If no group was set, default to "registered users"
//