Describe core revision actions cherrypick, rebase, submit

Exporting these actions as UiCommands makes them visible in
the actions map of a RevisionInfo if CURRENT_ACTIONS option
was requested by the client.

This gives the client hints about which actions the caller
can invoke at the time the RevisionInfo was retrieved.

Change-Id: I17510aed35e000e1d9fc9eb24c3646b4a72bfac9
This commit is contained in:
Shawn Pearce
2013-07-12 12:00:51 -07:00
parent 7e90035c09
commit d80cd41489
7 changed files with 162 additions and 11 deletions

View File

@@ -14,7 +14,6 @@
package com.google.gerrit.httpd.rpc.changedetail;
import com.google.gerrit.common.data.Capable;
import com.google.gerrit.common.data.ChangeDetail;
import com.google.gerrit.common.data.ChangeInfo;
import com.google.gerrit.common.data.SubmitRecord;
@@ -136,9 +135,7 @@ public class ChangeDetailFactory extends Handler<ChangeDetail> {
changeId));
detail.setCanRevert(change.getStatus() == Change.Status.MERGED && control.canAddPatchSet());
detail.setCanCherryPick(control.getProjectControl().canPushToAtLeastOneRef() == Capable.OK);
detail.setCanCherryPick(control.getProjectControl().canUpload());
detail.setCanEdit(control.getRefControl().canWrite());
detail.setCanEditCommitMessage(change.getStatus().isOpen() && control.canAddPatchSet());
detail.setCanEditTopicName(control.canEditTopicName());