-1

I want to stop patchset's owner to review and vote on their patchset in Gerrit. Currenlty i am using the follwoing code -

sum_list([], 0).
sum_list([H | Rest], Sum) :- sum_list(Rest,Tmp), Sum is H + Tmp.

add_category_min_score(In, Category, Min,  P) :-
    findall(2, gerrit:commit_label(label(Category,2),R),Z),
    sum_list(Z, Sum),
    Sum >= Min, !,
    gerrit:commit_label(label(Category, V), U),
    V >= 1,
    !,
    P = [label(Category,ok(U)) | In].

add_category_min_score(In, Category,Min,P) :-
    P = [label(Category,need(Min)) | In].

submit_rule(S) :-
    gerrit:default_submit(X),
    X =.. [submit | Ls],
    gerrit:remove_label(Ls,label('Code-Review',_),NoCR),
    add_category_min_score(NoCR,'Code-Review', 4, Labels),
    S =.. [submit | Labels].

I tried the following - Example - 8 and answer here.

Any help would be appriciable, Thanks!

i_am_beginner
  • 119
  • 3
  • 11

1 Answers1

0

I would do this in the access rights by adding this to the access rights :

[access "refs/heads/*"]
    label-Code-Review = block -2..+2 group Change Owner
uncletall
  • 6,609
  • 1
  • 27
  • 52