cvslog2web provides a link between your CVS commits and web output, via several formats:
- Atom syndication format (a standardized version of RSS, from IETF)
- XHTML "recently updated" index (as seen at right)
- Individual log entry pages ("permalinks")
Download package includes the cvslog2web.py script, default style sheet, and some feed and navigation icons. Documentation for installation and configuration is found at the beginning of the script.
Requirements
cvslog2web requires Python 2.3 or better, and requires only the standard modules. Development has targeted the Free Software Foundation's CVS, tested with 1.11.20 under Mac OS X, and 1.11.17 under Fedora Core 3. The CVSNT fork may work (not tested). Other implementations of CVS probably have a different log output format, and may require modifying the "Input Parsing" section of the script.
Features
I wrote this because I was frustrated with the difficult dependencies, lack of features, and/or lack of customization in other offerings. Features of cvslog2web include:
- Runs on standard Python distributions
- Smart parsing -- merges consecutive log updates into a single entry. (keeps cross-directory commits together in the same log entry)
This is necessary because CVS can run the log entry command multiple times per commit (once for each directory involved in the commit). A naïve implementation would list these as separate commits. cvslog2web merges them so your single commit shows up as a single log entry. - Compact file listings, streamlines the list of file names. An update of:
/foo/bar/baz /foo/bar/moo /foo/bar/pow/zingbecomes just one line:/foo/bar/{baz, moo, pow/zing} - Files listed in the log can link to ViewCVS/ViewVC for web-based diffs. (or other such package, the URL is configurable)
- Rerun the script manually anytime to rebuild output without needing to introduce a new log entry (handy for testing styling or structural changes):
$ python cvslog2web.py [config-file]
- XHTML output can be either a stand-alone page (either to view on its own, or embed with <iframe> or <frameset>), or a document fragment (to embed via server-side include, as is done on this page).
- Support for whitespace in file names! (not easy considering the format of output CVS provides to scripts like this, sigh...)
- Detailed CSS style support, structure of permalink pages completely configurable
- Valid XML output via Python's xml.dom module (not some error-prone string parsing I hacked together)
- For another example of usage, visit the Tekkotsu robot programming framework's staging server: tekkotsu.no-ip.org
Installation
cvslog2web is written in Python (version 2.3 or higher), and easily hooked into your CVS system by adding the following line to your loginfo file:
You can either customize configuration settings at the top of the script itself, or you can supply an optional config-file argument (as shown above) to override any or all settings. If a relative path is specified for config-file, it is interpreted relative to the location of the cvslog2web.py script. As an example, you can view the configuration file used for this site.
Note that the ALL keyword is a filter used by CVS to determine which files should be run through the specified command. By adding a series of entries to loginfo, it is possible to register the script for multiple, specific modules within your repository, each with a separate configuration file, and thus each generating a dedicated feed for that module.
Finally, I recommend storing the script in the CVSROOT directory of your repository. This guarantees that anyone who has access to commit into the repository also has access to run the script. If you follow this advice, path/to/ would be $CVSROOT/CVSROOT/
The download package also includes some stylesheet and images. The default placement for these files depends on the directory layout of your website, and can be controlled to varying degree by configuration settings:
- cvslog2web.css -- directly determined by HTMLOUT_CSS and PERMALINK_CSS, default to same directory as the html page (HTMLOUT), and root of the permalink directory structure respectively (could be the same location, depending on your configuration...)
- Atom.css -- same directory as the feed output (FEEDOUT)
This file is used to allow browsers without specific Atom/RSS support to display the feed nicely) - nav_prev.gif, nav_next.gif -- same directory as permalink's cvslog2web.css (PERMALINK_CSS)
- atom_feed.png, feed_icon.png -- Root of permalink structure (PERMALINK_URL_PREFIX)
Porting
Released under the GPL, you're welcome to hack around with the script. Although I prefer to support the Atom standard, it probably wouldn't be too hard to convert the feed output to one of the RSS format variants if you prefer.
Of more interest, I would love to see support for a Subversion hook. I know websvn has support for RSS feeds on a global or per-directory basis, but it lacks a number of the other features listed above. I think cvslog2web has nicer output format as well, such as more informative titles for entries in the feed.
Contact and Feedback
cvslog2web was written by Ethan Tira-Thompson. Please submit bug fixes, new features, etc. to ejt AT cs_cmu_edu.