Fix the latest-processed-revision pages
This commit is contained in:
parent
7f8ffb4bea
commit
75226a1499
2 changed files with 12 additions and 9 deletions
|
|
@ -96,20 +96,21 @@ WHERE git_branches.commit = $1")
|
|||
query
|
||||
(list branch-name git-repository-id))))
|
||||
|
||||
(define* (latest-processed-commit-for-branch conn branch-name)
|
||||
(define* (latest-processed-commit-for-branch conn repository-id branch-name)
|
||||
(define query
|
||||
(string-append
|
||||
"SELECT git_branches.commit "
|
||||
"FROM git_branches "
|
||||
"INNER JOIN guix_revisions ON git_branches.commit = guix_revisions.commit "
|
||||
"WHERE git_branches.name = $1 "
|
||||
"WHERE guix_revisions.git_repository_id = $1 AND "
|
||||
"git_branches.git_repository_id = $1 AND git_branches.name = $2 "
|
||||
"ORDER BY datetime DESC "
|
||||
"LIMIT 1"))
|
||||
|
||||
(match (exec-query
|
||||
conn
|
||||
query
|
||||
(list branch-name))
|
||||
(list repository-id branch-name))
|
||||
(((commit-hash))
|
||||
commit-hash)
|
||||
('()
|
||||
|
|
|
|||
|
|
@ -716,9 +716,9 @@
|
|||
'after_date)
|
||||
#:before-date (assq-ref parsed-query-parameters
|
||||
'before_date)))))))
|
||||
(('GET "branch" branch-name "latest-processed-revision")
|
||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision")
|
||||
(let ((commit-hash
|
||||
(latest-processed-commit-for-branch conn branch-name)))
|
||||
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||
(if commit-hash
|
||||
(render-view-revision mime-types
|
||||
conn
|
||||
|
|
@ -730,9 +730,9 @@
|
|||
(render-unknown-revision mime-types
|
||||
conn
|
||||
commit-hash))))
|
||||
(('GET "branch" branch-name "latest-processed-revision" "packages")
|
||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "packages")
|
||||
(let ((commit-hash
|
||||
(latest-processed-commit-for-branch conn branch-name)))
|
||||
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||
(if commit-hash
|
||||
(let ((parsed-query-parameters
|
||||
(guard-against-mutually-exclusive-query-parameters
|
||||
|
|
@ -761,14 +761,15 @@
|
|||
(samp ,branch-name))
|
||||
#:header-link
|
||||
(string-append
|
||||
"/repository/" repository-id
|
||||
"/branch/" branch-name
|
||||
"/latest-processed-revision")))
|
||||
(render-unknown-revision mime-types
|
||||
conn
|
||||
commit-hash))))
|
||||
(('GET "branch" branch-name "latest-processed-revision" "package" name version)
|
||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package" name version)
|
||||
(let ((commit-hash
|
||||
(latest-processed-commit-for-branch conn branch-name)))
|
||||
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||
(if commit-hash
|
||||
(render-revision-package mime-types
|
||||
conn
|
||||
|
|
@ -780,6 +781,7 @@
|
|||
(samp ,branch-name))
|
||||
#:header-link
|
||||
(string-append
|
||||
"/repository/" repository-id
|
||||
"/branch/" branch-name
|
||||
"/latest-processed-revision"))
|
||||
(render-unknown-revision mime-types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue