VCS::Lite::Repository - Minimal version Control system - Repository object


  use VCS::Lite::Repository;
  my $rep = VCS::Lite::Repository->new($ENV{VCSROOT});
  my $dev = $rep->clone('/home/me/dev');
  $dev->check_in( description => 'Apply change');


VCS::Lite::Repository is a freestanding version control system that is platform independent. The module is pure perl, and only makes use of other code that is available for all platforms.


  my $rep = VCS::Lite::Repository->new('/local/fileSystem/path');

A new repository object is created and associated with a directory on the local file system. If the directory does not exist, it is created. If the directory does not contain a repository, an empty repository is created.

The control files associated with the repository live under a directory .VCSLite inside the associated directory (_VCSLITE on VMS as dots are not allowed in directory names on this platform), and these are in YAML format. The repository directory can contain VCS::Lite elements (which are version controlled), other repository diretories, and also files and directories which are not version controlled.


  my $ele = $rep->add('');
  my $ele = $rep->add('mydir');

If given a directory, returns a VCS::Lite::Repository object for the subdirectory. If this does not already have a repository, one is created.

Otherwise it returns the VCS::Lite::Element object corresponding to a file of that name. The element is added to the list of elements inside the repository. If the file does not exist, it is created as zero length. If the file does exist, its contents become the generation 0 baseline for the element, otherwise generation 0 is the empty file.

The methods add_element and add_repository do the same thing, but check to make sure that the paremeter is a plain file (or a directory in the case of add_repository) and return undef if this is not the case. Add_repository will also create the directory if it does not exist.



This is the opposite of add. It does not delete any files, merely removes the association between the repository and the element or subrepository.



Apply a callback to each element and repository inside the repository. Either call a sub directly, or supply a method name. This is used to implement the check_in, commit and update methods for a repository.

check_in, commit, update

These methods use traverse to iterate all elements in the repository, and all subrepositories. See the documentation in VCS::Lite::Element for how these are applied to each element.



The environment variable USER is used to determine the author of changes. In a Unix environment, this should be adequate for out-of-the-box use. An additional environment variable, VCSLITE_USER is also checked, and this takes precedence.

Windows users will need to set one of these environment variables, or the application will croak with "Author not specified".

For more dynamic applications (such as CGI scripts that run as WWW, but receive the username from a cookie), you can set the package variable: $VCS::Lite::Repository::username. Note: there could be some problems with Modperl here - patches welcome.


Support for binary files. (Subclass VCS::Lite::Element)

Integration with VCS suite.


   Copyright (C) 2003-2004 Ivor Williams (IVORW (at) CPAN {dot} org)
   All rights reserved.

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


VCS::Lite::Element, VCS::Lite, YAML.