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 <edwin.kempin@sap.com>
This commit is contained in:
@@ -81,8 +81,7 @@ public class PublishDraft implements Callable<ReviewResult> {
|
||||
new AtomicUpdate<Change>() {
|
||||
@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;
|
||||
|
Reference in New Issue
Block a user