Ivan Wills
and 1 contributors


VCS::Which::Plugin - Base class for the various VCS plugins


This documentation refers to VCS::Which::Plugin version 0.6.4.


   use VCS::Which::Plugin;

   # Brief but working code example(s) here showing the most common usage(s)
   # This section will be as far as many users bother reading, so make it as
   # educational and exemplary as possible.


This is the base module for VCS::Which plugins. It is not used directly by itself. Many of the methods expect package variables to be defined by the plugin module.

This module is also usually called by VCS::Which and not the plugins directly as VCS::Which is set up to do the work to determine which plugin to use.


Plugins are expected to define the following variables

our $name

A pretty name to describe the version control system.

our $exe

The executable used by the vcs (eg svn, git etc)


new ()

Return: VCS::Which::Plugin - A new plugin object

Description: Simple constructor that should be inherited by plugins

name ()

Return: string - The pretty name for the System

Description: Returns the pretty name for the VCS

exe ()

Return: string - The name of the executable that is used to run operations with the appropriate plugin

Description: Returns name of the executable for the appropriate version control system.

installed ()

Return: bool - True if the VCS is installed

Description: Determines if VCS is actually installed and usable

used ($dir)

Param: $dir - string - Directory to check

Return: bool - True if the directory is versioned by this VCS

Description: Determines if the directory is under version control of this VCS

uptodate ($dir)

Param: $dir - string - Directory to check

Return: bool - True if the directory has no uncommitted changes

Description: Determines if the directory has no uncommitted changes

exec (@params)

Param: @params - array of strings - The parameters that you wish to pass on to the vcs program.

Description: Runs a command for the appropriate vcs. In void context it actually exec()s the command so never returns if the context is scalar or array backticks are used to run the command and the results are returned to the caller.

cat ( $file[, $revision] )

Param: $file - string - The name of the file to cat

Param: $revision - string - The revision to get. If the revision is negative it refers to the number of revisions old is desired. Any other value is assumed to be a version control specific revision. If no revision is specified the most recent revision is returned.

Return: The file contents of the desired revision

Description: Gets the contents of a specific revision of a file. This implementation works for many version control systems so may not be overloaded by specific plugins

versions ( [$file], [@args] )

Description: Gets all the versions of $file

pull ( [$dir] )

Description: Pulls or updates the directory $dir to the newest version

push ( [$dir] )

Description: push updates to parent repository must be implemented by plugin

add ( [$file] )

Add $file to VCS






There are no known bugs in this module.

Please report problems to Ivan Wills (ivan.wills@gmail.com).

Patches are welcome.


Ivan Wills - (ivan.wills@gmail.com)


Copyright (c) 2009 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW, Australia 2077). All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.