Add AnyWithBlock prolog function
Add a prolog function 'AnyWithBlock' that will block a submit on the lowest possible negative value. Any other value will enable a submit. Bug: Issue 2042 Change-Id: I56826db2eb63de9ea7150757240ad916f6e9f8a8
This commit is contained in:
parent
dac439b6a4
commit
d44ea94ece
@ -203,6 +203,12 @@ the highest possible positive value is required to enable submit. There
|
||||
must be at least one positive value, or else submit will never be
|
||||
enabled. To permit blocking submits, ensure a negative value is defined.
|
||||
|
||||
* `AnyWithBlock`
|
||||
+
|
||||
The lowest possible negative value, if present, blocks a submit, Any
|
||||
other value enables a submit. To permit blocking submits, ensure
|
||||
that a negative value is defined.
|
||||
|
||||
* `MaxNoBlock`
|
||||
+
|
||||
The highest possible positive value is required to enable submit, but
|
||||
|
@ -128,7 +128,7 @@ public class ProjectConfig extends VersionedMetaData {
|
||||
private static final String KEY_VALUE = "value";
|
||||
private static final String KEY_CAN_OVERRIDE = "canOverride";
|
||||
private static final Set<String> LABEL_FUNCTIONS = ImmutableSet.of(
|
||||
"MaxWithBlock", "MaxNoBlock", "NoBlock", "NoOp");
|
||||
"MaxWithBlock", "AnyWithBlock", "MaxNoBlock", "NoBlock", "NoOp");
|
||||
|
||||
private static final SubmitType defaultSubmitAction =
|
||||
SubmitType.MERGE_IF_NECESSARY;
|
||||
|
@ -239,6 +239,7 @@ default_submit([Type | Types], Tmp, Out) :-
|
||||
%% Apply the old -2..+2 style logic.
|
||||
%%
|
||||
legacy_submit_rule('MaxWithBlock', Label, Min, Max, T) :- !, max_with_block(Label, Min, Max, T).
|
||||
legacy_submit_rule('AnyWithBlock', Label, Min, Max, T) :- !, any_with_block(Label, Min, T).
|
||||
legacy_submit_rule('MaxNoBlock', Label, Min, Max, T) :- !, max_no_block(Label, Max, T).
|
||||
legacy_submit_rule('NoBlock', Label, Min, Max, T) :- !, T = may(_).
|
||||
legacy_submit_rule('NoOp', Label, Min, Max, T) :- !, T = may(_).
|
||||
@ -267,6 +268,7 @@ max_with_block(Label, Min, Max, ok(Who)) :-
|
||||
max_with_block(Label, Min, Max, need(Max)) :-
|
||||
true
|
||||
.
|
||||
|
||||
%TODO Uncomment this clause when group suggesting is possible.
|
||||
%max_with_block(Label, Min, Max, need(Max, Group)) :-
|
||||
% \+ check_label_range_permission(Label, Max, ok(_)),
|
||||
@ -276,6 +278,16 @@ max_with_block(Label, Min, Max, need(Max)) :-
|
||||
% \+ check_label_range_permission(Label, Max, ask(Group))
|
||||
% .
|
||||
|
||||
%% any_with_block:
|
||||
%%
|
||||
%% - The maximum is never used.
|
||||
%%
|
||||
any_with_block(Label, Min, reject(Who)) :-
|
||||
check_label_range_permission(Label, Min, ok(Who)),
|
||||
!
|
||||
.
|
||||
any_with_block(Label, Min, may(_)).
|
||||
|
||||
|
||||
%% max_no_block:
|
||||
%%
|
||||
|
Loading…
Reference in New Issue
Block a user