swh: 'lookup-origin-revision' ignores partial visits.

* guix/swh.scm (lookup-origin-revision): Filter out visits with a status
different from 'full.
This commit is contained in:
Ludovic Courtès 2021-05-14 23:21:45 +02:00
parent 67bf612554
commit 46eac03e72
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -455,7 +455,11 @@ (define (lookup-origin-revision url tag)
(match (lookup-origin url)
(#f #f)
(origin
(match (filter visit-snapshot-url (origin-visits origin))
(match (filter (lambda (visit)
;; Return #f if (visit-snapshot VISIT) would return #f.
(and (visit-snapshot-url visit)
(eq? 'full (visit-status visit))))
(origin-visits origin))
((visit . _)
(let ((snapshot (visit-snapshot visit)))
(match (and=> (find (lambda (branch)