Allow publishing old non-current patch sets

Change-Id: I32ec6a514c20c44f86aaa823cca157181b56c96e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-05-16 23:11:06 +02:00
parent 537d0bdb92
commit 15c4bfa7e8

View File

@@ -137,13 +137,11 @@ public class Publish implements RestModifyView<RevisionResource, Input>,
@Override
public UiAction.Description getDescription(RevisionResource rsrc) {
PatchSet.Id current = rsrc.getChange().currentPatchSetId();
try {
return new UiAction.Description()
.setTitle(String.format("Publish revision %d",
rsrc.getPatchSet().getPatchSetId()))
.setVisible(rsrc.getPatchSet().isDraft()
&& rsrc.getPatchSet().getId().equals(current)
&& rsrc.getControl().canPublish(dbProvider.get()));
} catch (OrmException e) {
throw new IllegalStateException(e);