[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Store output of most-recent-commits-for-branch in
From: |
Christopher Baines |
Subject: |
branch master updated: Store output of most-recent-commits-for-branch in a local variable |
Date: |
Sun, 29 Mar 2020 16:13:56 -0400 |
This is an automated email from the git hooks/post-receive script.
cbaines pushed a commit to branch master
in repository data-service.
The following commit(s) were added to refs/heads/master by this push:
new 6ee9a67 Store output of most-recent-commits-for-branch in a local
variable
6ee9a67 is described below
commit 6ee9a674cd1762fe3ea90f61b0f915e114c79053
Author: Danjela lura <address@hidden>
AuthorDate: Sun Mar 29 09:33:31 2020 +0200
Store output of most-recent-commits-for-branch in a local variable
Signed-off-by: Christopher Baines <address@hidden>
---
guix-data-service/web/repository/controller.scm | 70 +++++++++++--------------
1 file changed, 32 insertions(+), 38 deletions(-)
diff --git a/guix-data-service/web/repository/controller.scm
b/guix-data-service/web/repository/controller.scm
index 6735d10..9837867 100644
--- a/guix-data-service/web/repository/controller.scm
+++ b/guix-data-service/web/repository/controller.scm
@@ -70,44 +70,38 @@
`((after_date ,parse-datetime)
(before_date ,parse-datetime)
(limit_results ,parse-result-limit #:default 100)))))
- (case (most-appropriate-mime-type
- '(application/json text/html)
- mime-types)
- ((application/json)
- (render-json
- `((revisions
- . ,(list->vector
- (map (match-lambda
- ((date commit-hash _ _)
- `((date . ,date)
- (commit-hash . ,commit-hash))))
- (most-recent-commits-for-branch
- conn
- (string->number repository-id)
- branch-name
- #:limit (assq-ref parsed-query-parameters
'limit_results)
- #:after-date (assq-ref parsed-query-parameters
- 'after_date)
- #:before-date (assq-ref parsed-query-parameters
- 'before_date))))))))
- (else
- (render-html
- #:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
- (view-branch repository-id
- branch-name parsed-query-parameters '())
- (view-branch
- repository-id
- branch-name
- parsed-query-parameters
- (most-recent-commits-for-branch
- conn
- (string->number repository-id)
- branch-name
- #:limit (assq-ref parsed-query-parameters
'limit_results)
- #:after-date (assq-ref parsed-query-parameters
- 'after_date)
- #:before-date (assq-ref parsed-query-parameters
- 'before_date)))))))))
+ (let ((revisions
+ (most-recent-commits-for-branch
+ conn
+ (string->number repository-id)
+ branch-name
+ #:limit (assq-ref parsed-query-parameters 'limit_results)
+ #:after-date (assq-ref parsed-query-parameters
+ 'after_date)
+ #:before-date (assq-ref parsed-query-parameters
+ 'before_date))))
+ (case (most-appropriate-mime-type
+ '(application/json text/html)
+ mime-types)
+ ((application/json)
+ (render-json
+ `((revisions
+ . ,(list->vector
+ (map (match-lambda
+ ((date commit-hash _ _)
+ `((date . ,date)
+ (commit-hash . ,commit-hash))))
+ revisions))))))
+ (else
+ (render-html
+ #:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
+ (view-branch repository-id
+ branch-name parsed-query-parameters '())
+ (view-branch
+ repository-id
+ branch-name
+ parsed-query-parameters
+ revisions))))))))
(('GET "repository" repository-id "branch" branch-name "package"
package-name)
(let ((package-versions
(package-versions-for-branch conn
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Store output of most-recent-commits-for-branch in a local variable,
Christopher Baines <=