Skip to content

cvsclient: Handle error in fetch_rlog when path does not exist

When attempting to fetch the rlog for a path that does not exist in the repository, the CVS server will respond with the following lines:

E cvs rlog: could not read RCS file for ok

That error case was not handled in fetch_rlog so ensure it returns None when encountering it.

The issue was spotted when the loader attempts to fetch more rlog data from Attic directories. The paths of these Attic directories are computed from those of the files in the repositories but it exist cases where those directories do not exist.

It fixes the loading of that repository: ssh://anoncvs@anoncvs.NetBSD.org/cvsroot/htdocs. Code below triggers that issue prior that patch.

from urllib.parse import urlparse
from swh.loader.cvs.cvsclient import CVSClient

client = CVSClient(urlparse("ssh://anoncvs@anoncvs.NetBSD.org/cvsroot/htdocs"))
client.fetch_rlog(b"htdocs/docs/Hardware/Busses/Attic")

Migrated from D8675 (view on Phabricator)

Merge request reports