Prolog cookbook: fix several examples.
* The Example 13: 1+1=2 Code-Review was broken, the fix was missing in I131e2008ba
previous fix. Fix the following error:
test output invalid result: submit(label(Code-Review,ok(_535EC2E6))). Reason: A label with the status Code-Review: OK must contain a user.
* Example 6: Make change submittable if commit author is "John Doe" was
probably missing the user(ID)
Change-Id: I4126f01d979b4511faa83d4f779f83599c51c29a
diff --git a/Documentation/prolog-cookbook.txt b/Documentation/prolog-cookbook.txt
index 1c114e2..78497eb 100644
--- a/Documentation/prolog-cookbook.txt
+++ b/Documentation/prolog-cookbook.txt
@@ -544,6 +544,7 @@
Author = label('Author-is-John-Doe', need(_)).
submit_rule(submit(Author)) :-
+ A = user(1000000),
gerrit:commit_author(A, 'John Doe', 'john.doe@example.com'),
Author = label('Author-is-John-Doe', ok(A)).
----
@@ -899,7 +900,10 @@
findall(X, gerrit:commit_label(label(Category,X),R),Z),
sum_list(Z, Sum),
Sum >= Min, !,
- P = [label(Category,ok(R)) | In].
+ 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].