The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Apache::CVS - method handler provide a web interface to CVS repositories

SYNOPSIS

    <Location /cvs>
        SetHandler perl-script
        PerlHandler Apache::CVS::HTML
        PerlSetVar CVSRoots cvs1=>/usr/local/CVS
    </Location>

DESCRIPTION

Apache::CVS is a method handler that provide a web interface to CVS repositories. Please see "CONFIGURATION" to see what configuration options are available. To get started you'll at least need to set CVSRoots to your local CVS Root directory.

Apache::CVS is does not output the contents of your CVS repository on its own. Rather, it is meant to be subclassed. A subclass that yields HTML output is provided with Apache::CVS::HTML. Please see "SUBCLASSING" for details on creating your own subclass.

CONFIGURATION

Please see Apache::CVS::HTML for some extra configuration parameters specific to HTML display.

CVSRoots
    Location of the CVS Roots.  Set this like you would hash.  This
    variable is required.

    PerlSetVar CVSRoots cvs1=>/path/to/cvsroot1,cvs2=>/path/to/cvsroot2
RCSExtension
    File extension of RCS files.  Defaults to ',v'.

    PerlSetVar RCSExtension ,yourextension
WorkingDirectory
    A directory to keep temporary files.  Defaults to /var/tmp.
    Apache::CVS will try to clean up after itself and message to the
    error log if it couldn't.

    PerlSetVar WorkingDirectory /usr/tmp
BinaryDirectory
    The directory of the rcs binaries.  Defaults to /usr/bin.

    PerlSetVar BinaryDirectory /usr/local/bin
DiffStyles
    The different types of diffs you want to provide to users.
    The values will be passed to cvs diff as arguments. If not
    set users will see a unified diff.

    PerlSetVar DiffStyles unified=>ua,side-by-side=>ya
DefaultDiffStyle
    The default diff style. The value must be a valid predefined
    DiffStyle.  If not set or set incorrectly Apache::CVS will default to
    the first DiffStyle.

    PerlSetVar DefaultDiffStyle unified

SUBCLASSING

Override any or all of the following to customize the display. Some of these method will take a $uri_base as an argument. It is the URI for the current item that is being displayed. For example, if a directory is being displayed, the base URI is the URI to that directory. If a revision is being displayed, the base URI is the URI to that file.

$self->print_http_header()

Prints the HTTP headers. If you override this you should set the http_headers_sent flag with $self->http_headers_sent(1).

This method takes a string that contains the error.

No arguments. If you override this you should set the page_headers_sent flag with $self->page_headers_sent().

No arguments.

No arguments.

A root as a string, defined by your CVSRoots configuration.

No arguments.

Takes a base uri, the sort criterion, and the sort direction (1 for ascending). Overriding method should check file_sorting_available() to see if sorting controls should be provided.

Takes a base uri, an Apache::CVS::Directory object, and a row number.

Takes a base uri, an Apache::CVS::File object, and a row number.

sort_files

Takes a reference to a list of Apache::CVS::Files, a criterion, and a sort direction (1 for ascending). This is called before printing.

Takes a base uri, an Apache::CVS::PlainFile object, and a row number.

No arguments.

Takes a base uri, the sort criterion, and the sort direction (1 for ascending). Overriding method should check revision_sorting_available() to see if sorting controls should be provided.

Takes a base uri, an Apache::CVS::Revision object, a row number and the revision number of a revision that has been selected for diffing, if such exists.

sort_revisions

Takes a reference to a list of Apache::CVS::Revisions and a sort criterion. This is called before sorting.

No arguments.

Takes the content of the revision as a string.

Takes an Apache::CVS::Diff object and a base uri.

Takes a base uri and an Apache::CVS::Graph object. Only avaiable if built with --graph passed to Makefile.PL.

OBJECT METHODS

Here are some other methods that might be useful.

$self->request()

Returns the Apache request object.

$self->rcs_config()

Returns the Apache::CVS:RcsConfig object that holds the Rcs configuration.

$self->content_type()

Set or get the content_type.

$self->http_headers_sent()

Set or get this flag which indicates if the HTTP have been sent or not.

$self->page_headers_sent()

Set or get this flag which indicates if the page headers have been sent or not.

$self->path()

Set or get the path of to the file or directory requested.

$self->current_root()

Set or get the CVS Root of the files being requested.

$self->roots()

Returns the configured CVS Roots as a hash references.

$self->diff_styles()

Returns the different styles of diff that will be available.

$self->default_diff_style()

Returns the default diff styles.

$self->current_root_path()

Returns the path of the CVS Root of the files being requested. This is equivalent to $self->roots()->{$self->current_root()}.

$self->file_sorting_available()

Returns true if file sorting (in a directory) is implemented. Subclasses must set this to true or false where as necessary.

$self->revision_sorting_available()

Returns true if revision sorting (in a file) is implemented. Subclasses must set this to true or false where as necessary.

SEE ALSO

Apache::CVS::HTML, Rcs

AUTHOR

John Barbee <barbee@veribox.net>

COPYRIGHT

Copyright 2001-2002 John Barbee

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 31:

'=item' outside of any '=over'

Around line 96:

You forgot a '=back' before '=head1'