Move away from cgit to more flexible linking to repositories
This commit is contained in:
parent
36f30551cb
commit
5717ce82ce
19 changed files with 405 additions and 262 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#:use-module (squee)
|
||||
#:use-module (srfi srfi-19)
|
||||
#:use-module (guix-data-service model utils)
|
||||
#:use-module (guix-data-service model git-repository)
|
||||
#:export (git-branch-for-repository-and-name
|
||||
insert-git-branch-entry
|
||||
git-branches-for-commit
|
||||
|
|
@ -69,9 +70,7 @@ ORDER BY git_commits.datetime DESC")
|
|||
(define (git-branches-with-repository-details-for-commit conn commit)
|
||||
(define query
|
||||
"
|
||||
SELECT git_repositories.id, git_repositories.label,
|
||||
git_repositories.url, git_repositories.cgit_url_base,
|
||||
git_branches.name, git_commits.datetime
|
||||
SELECT git_repositories.id, git_branches.name, git_commits.datetime
|
||||
FROM git_commits
|
||||
INNER JOIN git_branches
|
||||
ON git_commits.git_branch_id = git_branches.id
|
||||
|
|
@ -79,9 +78,14 @@ INNER JOIN git_repositories
|
|||
ON git_branches.git_repository_id = git_repositories.id
|
||||
WHERE git_commits.commit = $1")
|
||||
|
||||
(group-list-by-first-n-fields
|
||||
4
|
||||
(exec-query conn query (list commit))))
|
||||
(map
|
||||
(match-lambda
|
||||
(((git-repository-id) . val)
|
||||
(cons (select-git-repository conn git-repository-id)
|
||||
val)))
|
||||
(group-list-by-first-n-fields
|
||||
1
|
||||
(exec-query conn query (list commit)))))
|
||||
|
||||
(define* (latest-processed-commit-for-branch conn repository-id branch-name)
|
||||
(define query
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue