diff options
Diffstat (limited to 'java/com/google/gerrit/entities')
-rw-r--r-- | java/com/google/gerrit/entities/Change.java | 28 | ||||
-rw-r--r-- | java/com/google/gerrit/entities/Permission.java | 2 |
2 files changed, 28 insertions, 2 deletions
diff --git a/java/com/google/gerrit/entities/Change.java b/java/com/google/gerrit/entities/Change.java index d1826bc6df..9157b5906a 100644 --- a/java/com/google/gerrit/entities/Change.java +++ b/java/com/google/gerrit/entities/Change.java @@ -322,9 +322,16 @@ public final class Change { private static final char MIN_OPEN = 'a'; /** Database constant for {@link Status#NEW}. */ public static final char STATUS_NEW = 'n'; + /** Maximum database status constant for an open change. */ private static final char MAX_OPEN = 'z'; + /** Database constant for {@link Status#STAGED}. */ + public static final char STATUS_STAGED = 'R'; + + /** Database constant for {@link Status#INTEGRATING}. */ + public static final char STATUS_INTEGRATING = 'I'; + /** Database constant for {@link Status#MERGED}. */ public static final char STATUS_MERGED = 'M'; @@ -358,6 +365,9 @@ public final class Change { */ NEW(STATUS_NEW, ChangeStatus.NEW), + STAGED(STATUS_STAGED, ChangeStatus.STAGED), + INTEGRATING(STATUS_INTEGRATING, ChangeStatus.INTEGRATING), + /** * Change is closed, and submitted to its destination branch. * @@ -372,7 +382,9 @@ public final class Change { * patch set, and it cannot be merged. Draft comments however may be published, permitting * reviewers to send constructive feedback. */ - ABANDONED('A', ChangeStatus.ABANDONED); + ABANDONED('A', ChangeStatus.ABANDONED), + + DEFERRED('D', ChangeStatus.DEFERRED); static { boolean ok = true; @@ -683,8 +695,20 @@ public final class Change { return getStatus().equals(Status.ABANDONED); } + public boolean isIntegrating() { + return getStatus().equals(Status.INTEGRATING); + } + + public boolean isStaged() { + return getStatus().equals(Status.STAGED); + } + + public boolean isDeferred() { + return getStatus().equals(Status.DEFERRED); + } + public boolean isClosed() { - return isAbandoned() || isMerged(); + return isAbandoned() || isMerged() || isStaged() || isIntegrating() || isDeferred(); } public String getTopic() { diff --git a/java/com/google/gerrit/entities/Permission.java b/java/com/google/gerrit/entities/Permission.java index 95164bdee5..ab583422b0 100644 --- a/java/com/google/gerrit/entities/Permission.java +++ b/java/com/google/gerrit/entities/Permission.java @@ -54,6 +54,7 @@ public abstract class Permission implements Comparable<Permission> { public static final String SUBMIT_AS = "submitAs"; public static final String TOGGLE_WORK_IN_PROGRESS_STATE = "toggleWipState"; public static final String VIEW_PRIVATE_CHANGES = "viewPrivateChanges"; + public static final String QT_STAGE = "stage"; public static final boolean DEF_EXCLUSIVE_GROUP = false; @@ -90,6 +91,7 @@ public abstract class Permission implements Comparable<Permission> { NAMES_LC.add(SUBMIT_AS.toLowerCase()); NAMES_LC.add(TOGGLE_WORK_IN_PROGRESS_STATE.toLowerCase()); NAMES_LC.add(VIEW_PRIVATE_CHANGES.toLowerCase()); + NAMES_LC.add(QT_STAGE.toLowerCase()); LABEL_INDEX = NAMES_LC.indexOf(Permission.LABEL); LABEL_AS_INDEX = NAMES_LC.indexOf(Permission.LABEL_AS.toLowerCase()); |