Rcs::Parser - Parse and analyze RCS files - v0.03


SYNOPSIS

A basic RCS parser. This file does not rely upon any external utilities to parse RCS files. Currently it functions with RCS files generated by GNU CVS and as documented by the rcsfile(5) man page.


MODULE INSTALLATION

To install this module type the following:

perl Makefile.PL
make
make test
make install


EXAMPLE USAGE

Retrieve the most recent file from an archive:

      my $rcs = new Rcs::Parser;
      my $ret = $rcs->load($filename);
  
      my $current = $rcs->recent_version;

To retrieve a specific version:

      my $rcs = new Rcs::Parser;
      my $ret = $rcs->load($filename);
  
      my $specific_version = $rcs->get('1.2');

METHODS

author($version)

my $author = $rcs->author($version);

The author method returns the author name of the given version. If no version is given it returns the author of the current loaded version.

date($version)

my $date = $rcs->date($version);

The date method returns the revision date of the given version. If no version is given it returns the date of the current version.

get($version)

my $ret = $rcs->get($version);

This method causes the given version to be retrieved from the archive

load($filename)

my $ret = $rcs->load($filename);

The load command reads in and parses the given filename. If the file does not exist or is unreadable by the script, undef is returned. Otherwise, 1 is returned upon success.

load_scalar($data)

my $ret = $rcs->load_scalar($data);

The load command reads in and parses the provided RCS file in scalar form. 1 is returned upon success.

notate()

my $ret = $rcs->notate()

This method builds and assembled statistical information for veriosn.

previous_version()

my $ver = $rcs->previous_version();

This method returns the version previous to the currently instanced version.

recent_version()

my $ver = $rcs->recent_version();

This method returns the most current revision of the file.

version()

my $ver = $rcs->version();

This method returns the currently instanced version.


KNOWN ISSUES

Beta Code:

This code is beta. It has yet to fully understand binary formats stored in RCS and will treat them as text. Consquently, you'll see warnings. That being said, there shouldn't be any large scale bugs that will cause segfaulting or crashing. Only warnings.

The RCS file format:

There is an astounding lack of good documentation of the RCS format. About the only thing that can be found is the rcsfile(5) man page. The layout is mostly reverse engineered in this module. I have yet to have the time, or the skill and patience to disassemble the RCS portions of the code for GNU CVS.


ERATTA

Q: Why 'Rcs' and not 'RCS'

  1. Because the any directory named 'RCS' is usually ignored by most versioning software and some developer tools.

AUTHORSHIP

Rcs::Parser v0.03 2004/04/02

(c) 2001-2008, Phillip Pollard <bennie@cpan.org> Released under the Perl Artistic License