From 2970f75eaf715beb0a7c74215408d89b279ea0ad Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Tue, 7 Feb 2012 15:37:03 +0100 Subject: [PATCH] Always set change status to NEW when a patch set gets published When a draft patch set of a draft change gets published the status of the change should change from DRAFT to NEW. Before this change the change status was only updated when the draft patch set that was published was the current patch set. This meant that if a previous draft patch set was published the change stayed in status DRAFT and the published patch set was not getting visible to other users. Also for changes in status DRAFT the WebUI allows to delete the complete change, which is failing if one of the patch sets was already published. If the change status is correctly updated to NEW the WebUI doesn't offer the deletion of the complete change anymore. Change-Id: I252e11d25b72621d27d1439d59e8d9d795c10010 Signed-off-by: Edwin Kempin --- .../com/google/gerrit/server/changedetail/PublishDraft.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/changedetail/PublishDraft.java b/gerrit-server/src/main/java/com/google/gerrit/server/changedetail/PublishDraft.java index 9f60ccbec6..1c04ff1827 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/changedetail/PublishDraft.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/changedetail/PublishDraft.java @@ -81,8 +81,7 @@ public class PublishDraft implements Callable { new AtomicUpdate() { @Override public Change update(Change change) { - if (change.getStatus() == Change.Status.DRAFT - && change.currentPatchSetId().equals(patchSetId)) { + if (change.getStatus() == Change.Status.DRAFT) { change.setStatus(Change.Status.NEW); ChangeUtil.updated(change); return change;