diff options
Diffstat (limited to 'guix-qa-frontpage')
-rw-r--r-- | guix-qa-frontpage/manage-patch-branches.scm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm index db4fdc9..9dcbd72 100644 --- a/guix-qa-frontpage/manage-patch-branches.scm +++ b/guix-qa-frontpage/manage-patch-branches.scm @@ -11,6 +11,7 @@ #:use-module (web client) #:use-module (json) #:use-module (guix sets) + #:use-module (guix memoization) #:use-module (guix build utils) #:use-module (guix-build-coordinator utils) #:use-module ((guix build download) #:select (http-fetch)) @@ -226,6 +227,19 @@ (latest-master-revision (get-latest-processed-branch-revision "master"))) + ;; Several series can use the same base revision, so memoize looking up + ;; the changes compared to master + (define get-changes-compared-to-master + (memoize + (lambda (base-commit) + (length + (revision-derivation-changes + (revision-derivation-changes-url + `((base . ,base-commit) + (target . ,latest-master-revision)) + ;; TODO: Maybe do something smarter here? + #:systems '("x86_64-linux"))))))) + (simple-format #t "checking for branches to delete (looking at ~A branches)\n" (length issue-numbers)) (for-each @@ -265,13 +279,7 @@ #f))) (lambda () (let ((derivation-change-count - (length - (revision-derivation-changes - (revision-derivation-changes-url - `((base . ,base-commit) - (target . ,latest-master-revision)) - ;; TODO: Maybe do something smarter here? - #:systems '("x86_64-linux")))))) + (get-changes-compared-to-master base-commit))) (if (> derivation-change-count 10000) (begin (simple-format |