Show the branches for a revision

This commit is contained in:
Christopher Baines 2019-05-18 12:36:03 +01:00
parent eb80905f0f
commit ed19764bc3
2 changed files with 27 additions and 2 deletions

View File

@ -88,6 +88,8 @@
commit-hash)
(let ((packages-count
(count-packages-in-revision conn commit-hash))
(git-repositories-and-branches
(git-branches-with-repository-details-for-commit conn commit-hash))
(derivations-counts
(count-packages-derivations-in-revision conn commit-hash)))
(case (most-appropriate-mime-type
@ -108,6 +110,7 @@
(view-revision
commit-hash
packages-count
git-repositories-and-branches
derivations-counts))))))
(define (texinfo->variants-alist s)

View File

@ -402,7 +402,8 @@
(td ,(build-status-span status)))))
derivations)))))))))
(define (view-revision commit-hash packages-count derivations-count)
(define (view-revision commit-hash packages-count
git-repositories-and-branches derivations-count)
(layout
#:extra-headers
'((cache-control . ((max-age . 60))))
@ -426,7 +427,28 @@
,packages-count)
(a (@ (href ,(string-append "/revision/" commit-hash
"/packages")))
"View packages"))
"View packages")
,@(if
(null? git-repositories-and-branches)
'()
`((h3 "Git repositories")
,@(map
(match-lambda
(((label url cgit-url-base) . branches)
`((h4 ,url)
,@(map
(match-lambda
((name datetime)
(if (string-null? cgit-url-base)
`(,name " at " ,datetime)
`(a (@ (href ,(string-append
cgit-url-base
"commit/?id="
commit-hash)))
,name " at " ,datetime))))
branches))))
git-repositories-and-branches))))
(div
(@ (class "col-md-6"))
(h3 "Derivations")