Swank Wiki
Recently Visited

Swank v0.04.04

Swank::RCS

Revision Control module, using the "rcs" revision control system.

Requires rcs to be installed, and uses the commands rcs, ci, co, and rlog.  (todo: make paths configurable from outside module.)

It provides all functions for doing revision control, and two top level actions for accessing old revisions.

If a page has a "norcs" field set, the revision history will not be saved for that file.  This can be useful for frequently changing data, such as session data pages.

The "history" action does 3 different things.  It shows the revision history by default.  It shows the old revision if a "revision" parameter is provided.  If "diffa" and "diffb" parameters are sent, it show the differences between those revisions.

The "revert" action restores a previous revision, given by the "revision" parameter.

ISA: Swank::Storage

Requires: Swank::Storage, Swank::Date, Swank, rcs

Provides:

history( page => $page_object, [revision=>$id], [revindex=>$n] )

This is not the history action.  This is just to retrieve revision history information.

Returns a list of revision info (newest first), each a hash with keys of (revision, date, author, comment).

Use the revision parameter to request specific revisions.  It will return the info hash for only that revision.

Use the revindex parameter to return an info hash without needing to know the revision identifier, for example the most recent (revindex=>0) or the first (revindex=>-1).

rcs_checkin -- private function saving revisions

Overrides:

read( ...  , revision=>$rev )

Adds support for revision argument to retrieve a specific revision. (used by /rcs/diff)

write

calls rcs_checkin() to checkin page after it is written

delete

checks in a blank page when a page is deleted, but leaves the rcs file intact.

top_action

When the action is "history" or "revert", loads the revision indicated by the "revision" io parameter.  For "revert" action, writes the old revision and redirects to it.

_openpath

Overridden to get old revisions (via "co -p") when requested instead of the current page.

Misfactored:

Swank::Page::history might be better if it were plugged in by this module.

Support Pages:

/rcs/history controls the display of the revision history.

/rcs/diff displays the differences between two revisions.