Minimal CVS client implementation
- swh.loader.cvs.cvsclient.decode_path(path: bytes) Tuple[str, str] #
Attempt to decode a file path based on encodings known to be used in CVS repositories that can be found in the wild.
path – raw bytes path
A tuple (decoded path, encoding)
- class swh.loader.cvs.cvsclient.CVSClient(url)#
Connect to a CVS server at the specified URL and perform the initial CVS protocol handshake.
- connect_pserver(hostname, port, username, password)#
- connect_ssh(hostname, port, username)#
- conn_write_str(s, encoding='utf-8')#
- checkout(path: bytes, rev: str, dest_dir: bytes, expand_keywords: bool)#
Download a file revision from the cvs server and store the file’s contents in a temporary file. If expand_keywords is set then ask the server to expand RCS keywords in file content.
From the server’s point of view this function behaves much like ‘cvs update -r rev path’. The server is unaware that we do not actually maintain a CVS working copy. Because of this it sends more information than we need. We simply skip responses that are of no interest to us.