Merge branch 'stable-2.8' into stable-2.9

* stable-2.8:
  Access-control: Adding drafts to examples
  Hide `refs/heads/` prefix in cherry-pick branch suggestion list
  Disable "save" button while saving commit message edit

Change-Id: Ib8bdf19e8e692025f015f9b85326caf78302ac8e
This commit is contained in:
David Pursehouse 2014-03-24 12:58:30 -07:00
commit fe847ec8be
3 changed files with 16 additions and 0 deletions

View File

@ -840,6 +840,17 @@ Suggested access rights to grant:
* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
If it's desired to have the possibility to upload temporarily hidden
changes there's a specific permission for that. This enables someone
to add specific reviewers for early feedback before making the change
publically visible. If you want to allow others than the owners to
publish a draft you also need to grant them `Publish Drafts`.
Optional access rights to grant:
* xref:category_push[`Push`] to 'refs/drafts/*'
* xref:category_publish_drafts[`Publish Drafts`] to 'refs/heads/*'
[[examples_developer]]
=== Developer

View File

@ -76,6 +76,7 @@ class EditMessageBox extends Composite {
@UiHandler("save")
void onSave(ClickEvent e) {
save.setEnabled(false);
ChangeApi.message(changeId.get(), revision, message.getText().trim(),
new GerritCallback<JavaScriptObject>() {
@Override

View File

@ -93,6 +93,10 @@ public abstract class CherryPickDialog extends ActionDialog {
@Override
public String getDisplayString() {
final String refsHeads = "refs/heads/";
if (branch.ref().startsWith(refsHeads)) {
return branch.ref().substring(refsHeads.length());
}
return branch.ref();
}