Staging instance, all changes can be removed at any time

Skip to content

support custom keywords during rsync:// conversion

CVS supports the definition of custom keywords. A common use case for custom keywords is to use the project name as a keyword. This avoids confusion when files are copied between projects using CVS, in case files contain a keyword that is in use by both projects. In other words, a file will retain its expanded custom keyword from project A, allowing to trace the initial file version back to its origin, after the file was copied into project B's CVS repository.

This feature is in active use by OpenBSD and NetBSD, for example. Existing conversions of their CVS repositories to Git expand the corresponding custom keywords as well, and so should we. Historically, X11 and FreeBSD were also using custom keywords.

During conversion via rsync:// we copy the CVSROOT directory and the desired CVS module from the rsync server. The file CVSROOT/config contains directives which configure the use of custom keywords. Parse this file and expand keywords accordingly when checking out versions of files from our local copy of the CVS repository.

For now, we only support custom keywords which correspond to the Id keyword since this is known to be in common use by projects. The latest releases of CVS (1.12.x) have optional support for arbitrary keyword aliases via custom keywords. Support for this could be added later, should there be a need to do so. In any case, the pserver access method already supports arbitrary custom keywords because such keywords will be expanded by the CVS server when we check out files from it.

While here, optimize our use of rsync a bit. Fetch only CVSROOT and the desired CVS module over rsync, rather than fetching the entire CVS repository directory, which may contain unrelated CVS modules that require disk space but will not be used.


Migrated from D6791 (view on Phabricator)

Merge request reports

Loading