Merge branch 'stable-2.7'

* stable-2.7:
  Return inherited boolean values for settings from /projects/*/config
  Clarify that file:regex over is:watched never works
  Update 2.7 release notes with recent changes

Conflicts:
	Documentation/rest-api-projects.txt

Change-Id: I65177933210a2384207eb5ade340f5062d0d2675
This commit is contained in:
Shawn Pearce 2013-07-12 09:58:52 -07:00
commit 5df857ca5a
4 changed files with 153 additions and 67 deletions

View File

@ -436,10 +436,26 @@ read access to `refs/meta/config`.
)]}'
{
"kind": "gerritcodereview#project_config",
"use_contributor_agreements": false,
"use_content_merge": true,
"use_signed_off_by": false,
"require_change_id": true,
"use_contributor_agreements": {
"value": true,
"configured_value": "TRUE",
"inherited_value": false
},
"use_content_merge": {
"value": true,
"configured_value": "INHERIT",
"inherited_value": true
},
"use_signed_off_by": {
"value": false,
"configured_value": "INHERIT",
"inherited_value": false
},
"require_change_id": {
"value": false,
"configured_value": "FALSE",
"inherited_value": true
}
"commentlinks": {}
}
----
@ -1042,6 +1058,43 @@ The base revision of the new branch. +
If not set, `HEAD` will be used as base revision.
|=======================
[[config-info]]
ConfigInfo
~~~~~~~~~~
The `ConfigInfo` entity contains information about the effective project
configuration.
Fields marked with * are only visible to users who have read access to
`refs/meta/config`.
[options="header",width="50%",cols="1,6"]
|======================================
|Field Name |Description
|`use_contributor_agreements*`|
link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
authors must complete a contributor agreement on the site before
pushing any commits or changes to this project.
|`use_content_merge*`|
link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
Gerrit will try to perform a 3-way merge of text file content when a
file has been modified by both the destination branch and the change
being submitted. This option only takes effect if submit type is not
FAST_FORWARD_ONLY.
|`use_signed_off_by*`|
link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
each change must contain a Signed-off-by line from either the author or
the uploader in the commit message.
|`require_change_id*`|
link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
valid link:user-changeid.html[Change-Id] footer in any commit uploaded
for review is required. This does not apply to commits pushed directly
to a branch or tag.
|`commentlinks`|
Comment link configuration for the project. Has the same format as the
link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[commentlink section]
of `gerrit.config`.
|======================================
[[dashboard-info]]
DashboardInfo
~~~~~~~~~~~~~
@ -1124,6 +1177,23 @@ The ref to which `HEAD` should be set, the `refs/heads` prefix can be
omitted.
|============================
[[inherited-boolean-info]]
InheritedBooleanInfo
~~~~~~~~~~~~~~~~~~~~
A boolean value that can also be inherited.
[options="header",width="50%",cols="1,^2,4"]
|================================
|Field Name ||Description
|`value` ||
The effective boolean value.
|`configured_value` ||
The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
|`inherited_value` |optional|
The boolean value inherited from the parent. +
Not set if there is no parent.
|================================
[[project-description-input]]
ProjectDescriptionInput
~~~~~~~~~~~~~~~~~~~~~~~
@ -1248,39 +1318,6 @@ statistics of a Git repository.
|`size_of_packed_objects` |Size of packed objects in bytes.
|======================================
[[config-info]]
ConfigInfo
~~~~~~~~~~
The `ConfigInfo` entity contains information about the effective project
configuration.
Fields marked with * are only visible to users who have read access to
`refs/meta/config`.
[options="header",width="50%",cols="1,6"]
|======================================
|Field Name |Description
|`use_contributor_agreements*`|
If set, authors must complete a contributor agreement on the site
before pushing any commits or changes to this project.
|`use_content_merge*`|
If set, Gerrit will try to perform a 3-way merge of text file content
when a file has been modified by both the destination branch and the
change being submitted. This option only takes effect if submit type is
not FAST_FORWARD_ONLY.
|`use_signed_off_by*`|
If set, each change must contain a Signed-off-by line from either the
author or the uploader in the commit message.
|`require_change_id*`|
If set, require a valid link:user-changeid.html[Change-Id] footer in any
commit uploaded for review. This does not apply to commits pushed
directly to a branch or tag.
|`commentlinks`|
Comment link configuration for the project. Has the same format as the
link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[commentlink section]
of `gerrit.config`.
|======================================
GERRIT
------

View File

@ -189,7 +189,10 @@ files named like 'name1.xml', 'name2.xml', and 'name3.xml' use
`file:"^name[1-3].xml"`.
+
Currently this operator is only available on a watched project
and may not be used in the search bar.
and may not be used in the search bar. The same holds true for web UI
"My > Watched Changes", i. e. file:regex is used over the is:watched
expression. It never produces any results, because the error message:
"operator not permitted here: file:regex" is suppressed.
[[has]]
has:draft::

View File

@ -6,6 +6,10 @@ Gerrit 2.7 is now available:
link:https://gerrit-releases.storage.googleapis.com/gerrit-2.7-rc2.war[https://gerrit-releases.storage.googleapis.com/gerrit-2.7-rc2.war]
Gerrit 2.7 includes the bug fixes done with
link:ReleaseNotes-2.6.1.html[Gerrit 2.6.1] and
link:ReleaseNotes-2.6.2.html[Gerrit 2.6.2]. These bug fixes are *not*
listed in these release notes.
Schema Change
-------------
@ -30,7 +34,7 @@ Release Highlights
* Comment links configurable per project.
* Themes configurable per project.
* Better support for binary files and images in diff screens.
* User avatars.
* User avatars in more places.
* Several new REST APIs.
@ -68,8 +72,8 @@ Only administrators and users having this capability are allowed to use `stream-
* Allow opening new changes on existing commits.
+
The %base argument can be used with refs/for/ to identify a specific revision the server should
start to look for new commits at. Any commits in the range $base..$tip will be opened as a new
The `%base` argument can be used with `refs/for/` to identify a specific revision the server should
start to look for new commits at. Any commits in the range `$base..$tip` will be opened as a new
change, even if the commit already has another change on a different branch.
* New setting `gitweb.linkDrafts` to control if gitweb links are shown on drafts.
@ -82,9 +86,11 @@ draft patch sets.
* Allow changes to be automatically submitted on push.
+
Teams that want to use Gerrit's submit strategies to handle contention on busy
branches can use %submit to create a change and have it
branches can use `%submit` to create a change and have it
link:link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.7/user-upload.html#auto_merge[
immediately submitted], if the caller has Submit permission on refs/for/<ref>.
immediately submitted], if the caller has Submit permission on `refs/for/<ref>`.
* Allow administrators to see all groups.
Web UI
@ -94,8 +100,12 @@ Web UI
Global
^^^^^^
* User avatars are displayed in several places in the Web UI. "Diffy" is used as
avatar for the Gerrit server itself.
* User avatars are displayed in more places in the Web UI.
* 'Diffy' is used as avatar for the Gerrit server itself.
* A popup with user profile information is shown when hovering the
mouse over avatar images.
Change Screens
@ -121,11 +131,11 @@ change comments.
Diff Screens
^^^^^^^^^^^^
* Show images in side-by-side and unified diffs
* Show images in side-by-side and unified diffs.
* Show diffed images above/below each other in unified diffs.
* Harmonize unified diff's styling of images with that of text
* Harmonize unified diff's styling of images with that of text.
REST API
@ -209,11 +219,13 @@ Include change-level messages to the payload returned from
the link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.7/rest-api-changes#get-change-detail[
Get Change Detail REST API endpoint].
* Correct URL encoding in 'GroupInfo'.
Email
~~~~~
* Log failure to access reviewer list for notification emails
* Log failure to access reviewer list for notification emails.
* Log when appropriate if email delivery is skipped.
@ -242,5 +254,5 @@ global capabilities].
* Clarify the
link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.7/config-gerrit.html#cache_names[
change cache configuration]
change cache configuration].

View File

@ -14,47 +14,81 @@
package com.google.gerrit.server.project;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.gerrit.extensions.restapi.RestReadView;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.Project.InheritableBoolean;
import com.google.gerrit.server.git.GitRepositoryManager;
import java.util.Map;
public class GetConfig implements RestReadView<ProjectResource> {
public static class ConfigInfo {
public final String kind = "gerritcodereview#project_config";
public Boolean useContributorAgreements;
public Boolean useContentMerge;
public Boolean useSignedOffBy;
public Boolean requireChangeId;
public Map<String, CommentLinkInfo> commentlinks;
public ThemeInfo theme;
}
@Override
public ConfigInfo apply(ProjectResource resource) {
ConfigInfo result = new ConfigInfo();
RefControl refConfig = resource.getControl()
.controlForRef(GitRepositoryManager.REF_CONFIG);
ProjectState project = resource.getControl().getProjectState();
ProjectState state = resource.getControl().getProjectState();
if (refConfig.isVisible()) {
result.useContributorAgreements = project.isUseContributorAgreements();
result.useContentMerge = project.isUseContentMerge();
result.useSignedOffBy = project.isUseSignedOffBy();
result.requireChangeId = project.isRequireChangeID();
InheritedBooleanInfo useContributorAgreements = new InheritedBooleanInfo();
InheritedBooleanInfo useSignedOffBy = new InheritedBooleanInfo();
InheritedBooleanInfo useContentMerge = new InheritedBooleanInfo();
InheritedBooleanInfo requireChangeId = new InheritedBooleanInfo();
useContributorAgreements.value = state.isUseContributorAgreements();
useSignedOffBy.value = state.isUseSignedOffBy();
useContentMerge.value = state.isUseContentMerge();
requireChangeId.value = state.isRequireChangeID();
Project p = state.getProject();
useContributorAgreements.configuredValue = p.getUseContributorAgreements();
useSignedOffBy.configuredValue = p.getUseSignedOffBy();
useContentMerge.configuredValue = p.getUseContentMerge();
requireChangeId.configuredValue = p.getRequireChangeID();
ProjectState parentState = Iterables.getFirst(state.parents(), null);
if (parentState != null) {
useContributorAgreements.inheritedValue = parentState.isUseContributorAgreements();
useSignedOffBy.inheritedValue = parentState.isUseSignedOffBy();
useContentMerge.inheritedValue = parentState.isUseContentMerge();
requireChangeId.inheritedValue = parentState.isRequireChangeID();
}
result.useContributorAgreements = useContributorAgreements;
result.useSignedOffBy = useSignedOffBy;
result.useContentMerge = useContentMerge;
result.requireChangeId = requireChangeId;
}
// commentlinks are visible to anyone, as they are used for linkification
// on the client side.
result.commentlinks = Maps.newLinkedHashMap();
for (CommentLinkInfo cl : project.getCommentLinks()) {
for (CommentLinkInfo cl : state.getCommentLinks()) {
result.commentlinks.put(cl.name, cl);
}
// Themes are visible to anyone, as they are rendered client-side.
result.theme = project.getTheme();
result.theme = state.getTheme();
return result;
}
public static class ConfigInfo {
public final String kind = "gerritcodereview#project_config";
public InheritedBooleanInfo useContributorAgreements;
public InheritedBooleanInfo useContentMerge;
public InheritedBooleanInfo useSignedOffBy;
public InheritedBooleanInfo requireChangeId;
public Map<String, CommentLinkInfo> commentlinks;
public ThemeInfo theme;
}
public static class InheritedBooleanInfo {
public Boolean value;
public InheritableBoolean configuredValue;
public Boolean inheritedValue;
}
}