diff options
-rw-r--r-- | guix-qa-frontpage/git-repository.scm | 24 | ||||
-rw-r--r-- | scripts/guix-qa-frontpage.in | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/guix-qa-frontpage/git-repository.scm b/guix-qa-frontpage/git-repository.scm index 6ff3eb2..15f8fec 100644 --- a/guix-qa-frontpage/git-repository.scm +++ b/guix-qa-frontpage/git-repository.scm @@ -14,6 +14,7 @@ #:use-module (guix build utils) #:use-module ((guix build utils) #:select (with-directory-excursion)) #:export (%git-repository-location + %git-repository-patches-remote-use-ssh? ensure-repository-exists! update-repository! @@ -29,6 +30,15 @@ (define %git-repository-location (make-parameter #f)) +(define %git-repository-patches-remote-use-ssh? + (make-parameter #f)) + +(define* (patches-repository-remote-url + #:key (use-ssh? (%git-repository-patches-remote-use-ssh?))) + (if use-ssh? + "git@git.qa.guix.gnu.org:guix-patches" + "https://git.qa.guix.gnu.org/git/guix-patches")) + (define* (guix.git-excursion thunk #:optional dir) (when (current-scheduler) (error "guix.git-excursion can't be used from fibers")) @@ -51,12 +61,24 @@ (invoke "git" "remote" "add" "origin" "https://git.savannah.gnu.org/git/guix.git") (invoke "git" "remote" "add" "patches" - "git@git.qa.guix.gnu.org:guix-patches") + (patches-repository-remote-url)) (invoke "git" "config" "user.name" "Guix Patches Tester") (invoke "git" "config" "user.email" ""))))))) (define (update-repository!) + (let* ((repo (repository-open (%git-repository-location))) + (patches-remote + (remote-lookup repo "patches")) + (current-patches-url + (remote-url patches-remote))) + (unless (string=? + (patches-repository-remote-url) + current-patches-url) + (remote-set-url! repo + "patches" + (patches-repository-remote-url)))) + (with-bare-git-repository (lambda () (invoke "git" "prune") diff --git a/scripts/guix-qa-frontpage.in b/scripts/guix-qa-frontpage.in index 4e1aa2e..7f070ee 100644 --- a/scripts/guix-qa-frontpage.in +++ b/scripts/guix-qa-frontpage.in @@ -268,6 +268,8 @@ (with-fluids ((%file-port-name-canonicalization 'none)) (parameterize ((%git-repository-location (string-append (getcwd) "/guix.git")) + (%git-repository-patches-remote-use-ssh? + (assq-ref opts 'manage-patch-branches)) (%patchwork-series-default-count patch-issues-to-show)) (let* ((metrics-registry (make-metrics-registry #:namespace |