This area is an archive and is no longer actively maintained. Information found on this page is likely to be extremely out of date and therefore highly inaccurate. We recommend the Ximbiot - CVS Wiki for up-to-date information about CVS and its associtated tools.

If you do find anything useful on this page that is not yet in the Ximbiot - CVS Wiki and you have the time, please add it!

Writing CVS-related software in various languages

Writing CVS-related software in various languages

This page is aimed at helping you write CVS-related software in a variety of programming languages, with a focus on API's which let you call CVS in a manner which may be somewhat cleaner than spawning the CVS command line client as a subprocess.

C/C++

One common approach is to start with the code from the CVS command line client, and modify it as needed. This is the approach taken by MacCVS/WinCVS and gCVS. As far as I know, no one has done a lot of work in terms of trying to separate the "client library" from the command-line specific functionality with some kind of API separating them.

C++

Might be worth a look at whether MacCVSClient has code worth borrowing. I don't happen to know whether the part you'd want to borrow is well-separated from the rest, nor how easy it would be to port this code beyond the Macintosh.

perl

For a few examples, see scripts for cvs annotate and cvs admin -t.

Or another tack is to access CVS via the VCS module. Here are a few thoughts about how a CVS module might be done (which probably don't have anything to do with how VCS does it).

Java

The classes from jCVS which access CVS are usable in other applications. For example see the jCVS servlet at that page.

ECMAscript (javascript)

Our DOM page has a few ideas on getting CVS data from ECMAscript. Some of the ideas, if not all the details, suggested there should be usable in vanilla ECMAscript as well as DOM-enabled ECMAscript.

Or for another approach, the Rhino/LiveConnect products let one call Java code from Javascript, and one can use the jCVS classes to access CVS. This is apparently fairly clean.

Python

One interesting suggestion is to use the classes from jCVS along with JPython. This seems to me like it might be a pretty cool way to do it.

For more information

For more information on JPython (or Python in general) see the Python page maintained by the Python Software Activity.

[Cyclic Home]

Derek Price, CVS developer and technical editor of Essential CVS (Essentials line from O'Reilly Press) , and others offer consulting services and training through Ximbiot.