JRCS is a library that knows how to manipulate the archive files produced by the RCS and CVS version control systems. JRCS is not intended to replace neither tool. JRCS was written to be able create archive analysis tools that can do things like identify hot spots in the source code, measure the contributions by each developer, or assess how bugs make it in.
The reasons why JRCS has the ability do do check-ins and save archives is API symmetry, and to simplify the writing of unit tests.
CAVEAT UTILITOR: Do not make modifications to your archives with JRCS. There needs to be an important amount of additional testing before it's safe to do that.
The {@link org.apache.commons.jrcs.rcs rcs} package implements thearchive handling functionality. The entry point to the library is class {@link org.apache.commons.jrcs.rcs.Archive Archive}.
The {@link org.apache.commons.jrcs.diff diff} package implementsthe differencing engine that JRCS uses. The engine has the power of Unix diff, is simple to understand, and can be used independently of the archive handling functionality. The entry point to the differencing engine is class {@link org.apache.commons.jrcs.diff.Diff Diff}.
Within this library, the word text means a unit of information subject to version control. The word revision means a particular version of a text. Each revision has a version number associated to it. Version numbers are dot-separated lists of numbers. Version numbers with an odd number of dots indicate revisions, while those with an even number of dots (including zero dots) designate branches.
Revisions of a text are represented as Object[]
because the diff engine is capable of handling more than plain text. In fact, arrays of any type that implements {@link java.lang.Object#hashCode hashCode()} and{@link java.lang.Object#equals equals()}correctly can be subject to differencing and version control using this library.
To create an empty archive use: Archive archive = new Archive();
To read an archive from the file system, use: Archive archive = new Archive("/path/to/archive,v");
You can also initialize archives from streams.
To retreive a revision from an archive use: String versionNumber = "1.2"; Object[] text = archive.getRevision(versionNumber);
You can also retreive revisions in such a way that each item is annotated with the version number of the revision in which it was last changed or added. To retrieve annotated text use: String versionNumber = "1.2"; {@link Line Line[]} text = archive.getRevision(versionNumber);for(int i = 0; i < text.length(); i++) System.out.println(text[i].revision.version);
This class is NOT thread safe.
@see org.apache.commons.jrcs.diff @version $Id: Archive.java,v 1.9 2003/10/13 07:59:46 rdonkin Exp $ @author Juanco Anez
|
|
|
|
|
|