Implement 'privateByDefault' option for project.config

This change adds an inherited 'privateByDefault' option,
which allows project owners to configure a project so that
all new changes will be set as private by default.

This change also removes the 'privateByDefault' config option
from gerrit.config introduced by [1] as it's not necessary any
more (enable the 'privateByDefault' in All-Project will be
inherited by all other projects).

[1] Ie7cdb6f714714

Change-Id: I6fea9f8d55c7a38ac293057681874e9b480341ed
This commit is contained in:
Changcheng Xiao
2017-08-10 14:05:22 +02:00
parent bbb3708fc0
commit d089b4adda
19 changed files with 153 additions and 30 deletions

View File

@@ -147,6 +147,10 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
p.setRejectImplicitMerges(input.rejectImplicitMerges);
}
if (input.privateByDefault != null) {
p.setPrivateByDefault(input.privateByDefault);
}
if (input.maxObjectSizeLimit != null) {
p.setMaxObjectSizeLimit(input.maxObjectSizeLimit);
}
@@ -258,7 +262,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
value,
v.getKey()));
}
//$FALL-THROUGH$
// $FALL-THROUGH$
case STRING:
cfg.setString(v.getKey(), value);
break;