Class Parser.RCS

Inheritance graph
Parser._RCS Parser.RCS

A RCS file parser that eats a RCS *,v file and presents nice pike data structures of its contents.

Inherit _RCS

inherit Parser._RCS : _RCS

Constant max_revisions_supported

constant int Parser.RCS.max_revisions_supported


Feature detection constant for the max_revisions argument to create(), parse() and parse_delta_sections().

Variable access

array(string) Parser.RCS.access


The usernames listed in the ACCESS section of the RCS file.

Variable branch

string|int(0) Parser.RCS.branch


The default branch (or revision), if present, 0 otherwise.

Variable branches

mapping(string:string) Parser.RCS.branches


Maps branch numbers (indices) to branch names (values).


The indices are short branch revision numbers (ie "1.1.2" and not "").

Variable comment

string|int(0) Parser.RCS.comment


The RCS file comment if present, 0 otherwise.

Variable description

string Parser.RCS.description


The RCS file description.

Variable expand

string Parser.RCS.expand


The keyword expansion options (as named by RCS) if present, 0 otherwise.

Variable head

string Parser.RCS.head


Version number of the head version of the file.

Variable locks

mapping(string:string) Parser.RCS.locks


Maps from username to revision for users that have acquired locks on this file.

Variable rcs_file_name

string Parser.RCS.rcs_file_name


The filename of the RCS file as sent to create().

Variable revisions

mapping(string:Revision) Parser.RCS.revisions


Data for all revisions of the file. The indices of the mapping are the revision numbers, whereas the values are the data from the corresponding revision.

Variable strict_locks

bool Parser.RCS.strict_locks


1 if strict locking is set, 0 otherwise.

Variable tags

mapping(string:string) Parser.RCS.tags


Maps tag names (indices) to tagged revision numbers (values).


This mapping typically contains raw revision numbers for branches (ie "" and not "1.1.2").

Variable trunk

array(Revision) Parser.RCS.trunk


Data for all revisions on the trunk, sorted in the same order as the RCS file stored them - ie descending, most recent first, I'd assume (rcsfile(5), of course, fails to state such irrelevant information).

Method create

Parser.RCS Parser.RCS(string|void file_name, string|int(0)|void file_contents, void|int max_revisions)


Initializes the RCS object.

Parameter file_name

The path to the raw RCS file (includes trailing ",v"). Used mainly for error reporting (truncated RCS file or similar). Stored in rcs_file_name.

Parameter file_contents

If a string is provided, that string will be parsed to initialize the RCS object. If a zero (0) is sent, no initialization will be performed at all. If no value is given at all, but file_name was provided, that file will be loaded and parsed for object initialization.

Parameter max_revisions

Maximum number of revisions to process. If unset, all revisions will be processed.