Allow to delete non current draft patch sets

Change-Id: Ifa7701d0601d4291a9805572cc4cd6da693e1590
This commit is contained in:
David Ostrovsky
2013-09-27 08:34:14 +02:00
parent 0cef18b2b9
commit ebad71fcfe

View File

@@ -87,7 +87,6 @@ public class DeleteDraftPatchSet implements RestModifyView<RevisionResource, Inp
@Override
public UiAction.Description getDescription(RevisionResource rsrc) {
PatchSet.Id current = rsrc.getChange().currentPatchSetId();
try {
int psCount = dbProvider.get().patchSets()
.byChange(rsrc.getChange().getId()).toList().size();
@@ -95,7 +94,6 @@ public class DeleteDraftPatchSet implements RestModifyView<RevisionResource, Inp
.setTitle(String.format("Delete Draft Revision %d",
rsrc.getPatchSet().getPatchSetId()))
.setVisible(rsrc.getPatchSet().isDraft()
&& rsrc.getPatchSet().getId().equals(current)
&& rsrc.getControl().canDeleteDraft(dbProvider.get())
&& psCount > 1);
} catch (OrmException e) {