Subject: Re: bug#48971: [PATCH 0/2] Add SWH support for Hg repositories

From: Ludovic Courtès <[email-masked]>
Date: Mon, 14 Jun 2021 18:44:40 +0200

Hello,

Xinglu Chen <[email-masked]> skribis:

> Xinglu Chen (2):
>   swh: Support lookup of Hg tags.
>   hg-download: Support falling back to SWH.

Pushed as 69d7333217ce85d9d1643a8349757b6b170d3b1f!

Note that currently this only works for (1) repositories that are
archived, and (2) origins that refer to hg tags, not commit IDs.

I found an example that meets these criteria: python-openpyxl.  :-)
I commented out the other fallbacks in (guix hg-download) and ran:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build python-openpyxl -S --no-substitutes 
The following derivation will be built:
   /gnu/store/71xjlgdqw50a76ycqrmjrqh7b4mdi5s7-python-openpyxl-3.0.5-checkout.drv
building /gnu/store/71xjlgdqw50a76ycqrmjrqh7b4mdi5s7-python-openpyxl-3.0.5-checkout.drv...
guile: warning: failed to install locale
environment variable `PATH' set to `/gnu/store/378zjf2kgajcfd7mfr98jn5xyc5wa3qv-gzip-1.10/bin:/gnu/store/sf3rbvb6iqcphgm1afbplcs72hsywg25-tar-1.32/bin'
Trying to download from Software Heritage...
SWH: found revision 4d4e19e58314de481b98f4c239c3b3e9fd080613 with directory at 'https://archive.softwareheritage.org/api/1/directory/fb5bbba156e6b8e2bb94ea1dd5807ef2c8931864/'
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
SWH vault: requested bundle cooking, waiting for completion...
--8<---------------cut here---------------end--------------->8---

It’s still waiting for the bundle…

Regarding #2, there are some good news:
<https://forge.softwareheritage.org/T2849> is about implementing a
mapping from “VCS IDs” (hg commit IDs in this case) to SWHIDs.  Thus,
eventually, ‘lookup-origin-revision’ should be able to take an hg commit
ID and to map it to an SWHID.  That JSON API isn’t exposed yet.

Thanks,
Ludo’.