GNU bug report logs - #69328
[PATCH 00/12] Better source code recovery from SWH

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 23 Feb 2024 14:46:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #71 received at 69328 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 69328 <at> debbugs.gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH v2 05/12] swh: ‘origin-visits’ takes an optional ‘max’ parameter.
Date: Tue,  5 Mar 2024 12:06:53 +0100
* guix/swh.scm (origin-visits): Add optional ‘max’ parameter and honor
it.

Change-Id: I642d7d4b0672b68fb5c7ce2b49161307e13d3c95
---
 guix/swh.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guix/swh.scm b/guix/swh.scm
index 83f67423c8..14c65f6806 100644
--- a/guix/swh.scm
+++ b/guix/swh.scm
@@ -474,10 +474,11 @@ (define* (lookup-directory-by-nar-hash hash #:optional (algorithm 'sha256))
                              hash)
          external-id-target))
 
-(define (origin-visits origin)
-  "Return the list of visits of ORIGIN, a record as returned by
-'lookup-origin'."
-  (call (swh-url (origin-visits-url origin))
+(define* (origin-visits origin #:optional (max 10))
+  "Return the list of the up to MAX latest visits of ORIGIN, a record as
+returned by 'lookup-origin'."
+  (call (string-append (swh-url (origin-visits-url origin))
+                       "?per_page=" (number->string max))
         (lambda (port)
           (map json->visit (vector->list (json->scm port))))))
 
-- 
2.41.0





This bug report was last modified 1 year and 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.