The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rcs::Parser - Parse and analyze RCS files.

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.

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 verions.

all_versions()

my @versions = $rcs->all_versions();

This method returns an array or arrayref of all versions stored in the RCS file.

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'

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

BUGS AND SOURCE

        Bug tracking for this module: https://rt.cpan.org/Dist/Display.html?Name=Rcs-Parser

        Source hosting: http://www.github.com/bennie/perl-Rcs-Parser

VERSION

    Rcs::Parser v0.08 (2014/03/09)

COPYRIGHT

    (c) 2001-2014, Phillip Pollard <bennie@cpan.org>

LICENSE

This source code is released under the "Perl Artistic License 2.0," the text of which is included in the LICENSE file of this distribution. It may also be reviewed here: http://opensource.org/licenses/artistic-license-2.0