swh.loader.cvs.cvsclient module#

Minimal CVS client implementation

swh.loader.cvs.cvsclient.scramble_password(password)[source]#
swh.loader.cvs.cvsclient.decode_path(path: bytes) Tuple[str, str][source]#

Attempt to decode a file path based on encodings known to be used in CVS repositories that can be found in the wild.

Parameters:

path – raw bytes path

Returns:

A tuple (decoded path, encoding)

exception swh.loader.cvs.cvsclient.CVSProtocolError[source]#

Bases: Exception

class swh.loader.cvs.cvsclient.CVSClient(url)[source]#

Bases: object

Connect to a CVS server at the specified URL and perform the initial CVS protocol handshake.

connect_pserver(hostname, port, username, password)[source]#
connect_ssh(hostname, port, username)[source]#
connect_fake()[source]#
conn_read_line(require_newline=True)[source]#
conn_write(data)[source]#
conn_write_str(s, encoding='utf-8')[source]#
conn_close()[source]#
fetch_rlog(path: bytes = b'', state='')[source]#
checkout(path: bytes, rev: str, dest_path: bytes, expand_keywords: bool)[source]#

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.