Allow publishing old non-current patch sets
Change-Id: I32ec6a514c20c44f86aaa823cca157181b56c96e Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -137,13 +137,11 @@ public class Publish implements RestModifyView<RevisionResource, Input>,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UiAction.Description getDescription(RevisionResource rsrc) {
|
public UiAction.Description getDescription(RevisionResource rsrc) {
|
||||||
PatchSet.Id current = rsrc.getChange().currentPatchSetId();
|
|
||||||
try {
|
try {
|
||||||
return new UiAction.Description()
|
return new UiAction.Description()
|
||||||
.setTitle(String.format("Publish revision %d",
|
.setTitle(String.format("Publish revision %d",
|
||||||
rsrc.getPatchSet().getPatchSetId()))
|
rsrc.getPatchSet().getPatchSetId()))
|
||||||
.setVisible(rsrc.getPatchSet().isDraft()
|
.setVisible(rsrc.getPatchSet().isDraft()
|
||||||
&& rsrc.getPatchSet().getId().equals(current)
|
|
||||||
&& rsrc.getControl().canPublish(dbProvider.get()));
|
&& rsrc.getControl().canPublish(dbProvider.get()));
|
||||||
} catch (OrmException e) {
|
} catch (OrmException e) {
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
|
Reference in New Issue
Block a user