Ivan Wills
and 1 contributors


VCS::Which - Generically interface with version control systems


This documentation refers to VCS::Which version 0.6.4.


   use VCS::Which;

   # create a new object
   my $vcs = VCS::Which->new();

   if ( !$vcs->uptodate('.') ) {
       warn "Directory has uncommitted changes\n";


This module provides methods to interface with a version control system (vcs) with out having to care which command to use or which sub command in needed for several basic operations like checking if there are any uncommitted changes.



Initializes the VCS::Which object.

load_systems ()

Description: Creates new objects for each version control system found

get_systems ()

Description: Searches for version control systems plugins installed

capabilities ( [$dir] )

Param: $dir - string - Directory to base out put on

Return: list context - The data for each system's capabilities scalar context - A string displaying each system's capabilities

Description: Gets the capabilities of each system and returns the results

which ( [$dir] )

Param: $dir - string - Directory to work out which system it is using

Return: VCS::Which::Plugin - Object which can be used against the directory

Description: Determines which version control plugin can be used to with the supplied directory.

uptodate ( $dir )

Param: $dir - string - Directory to base out put on

Return: bool - True if the everything is checked in for the directory

Description: Determines if there are any changes that have not been committed to the VCS running the directory.

exec ( @args )

Param: @args - array - Arguments to pass on to the appropriate vcs command

Description: Runs the appropriate vcs command with the parameters supplied

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.

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

Param: $file - string - The name of the file or directory to get the log of

Param: @args - strings - Any other arguments to pass to the log command

Return: The log out put

Description: Gets the log of changes (optionally limited to a file)

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: Pushes content to master repository for distributed VCS systems

status ( [$dir] )

Return: HASHREF - Status of files

Description: Get the statuses of all files not added or not committed in the repository.

add ( [$file] )

Add $file to VCS

checkout ( [$dir] )

Checkout clean copy of $file



The directory base for the VCS operation to be carried out.


All the available VCS system plugins found.






The initial template usually just has:

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.