VCS::Lite::Shell - Non OO wrapper for VCS::Lite::Repository


  use VCS::Lite::Shell;

  store('current' => 'YAML');
  store('parent' => 'YAML');
  check_in("Add to repository");


This module is a thin wrapper for the object orientated calls to methods and repositories. It is aimed at programmers who don't want to embrace the fullness of Perl-OO that is used in VCS::Lite::Repository. The aim is to provide the full functionality of the VCS Lite repository via exportable subs. This interface is used by the VCShell command shell.

The module retains a context of the current repository store and current working directory. Move around with chdir, and the subroutines will operate on the current working directory and the contents thereof.

The functions check_out, commit and update operate on a pair of repository trees: the current repository and parent repository.




The first example adds the file to the current repository. The second example adds 01_basic.t to the repository t, having first added the repository t to the current repository if this was necessary.



The opposite operation to add is remove. Note that this does not get rid of the file from the directory, nor the element information. It merely removes from the list of elements in the current repository.


  check_in('', description => 'Fix foo bugs');
  check_in('.', description => 'Prepare version 0.01 for release');

Checking in an element stores the contents of the file into the element store. If the contents of the file is different from what was in the store already, a new generation of the element is created; if the contents is identical, no new generation is created.

Checking in a repository has two effects: any transactions to the repository, i.e. adds and removes, are committed to the repository's transaction history, and the check_in is applied recursively to everything (now) in the repository.


Checking out generates a new tree of repositories and elements, putting in place a relationship between the repositories; the original is the parent repository.


  print fetch('');
  my $old_foo = fetch('', 1);   # Generation 1 of

Fetch returns a scalar containing the contents of an element. The second parameter is the generation number, which defaults to the latest one.


  print diff (file1 => '');  # between latest checked in and outside
  print diff (file1 => '', gen1 => 1, gen2 => 3);
  print diff (file1 => '', file2 => '', gen2 => 'latest');

Diff returns the udiff output (similar to diff -u) between two generations, or between a generation and the file outside. The parameter file1 is mandatory, all others are optional. The parameter file2 defaults to the value of file1; gen1 defaults to the latest generation of file1.

If no gen2 is specified, diff uses the file file2 outside the repository (file1 if no file2 is specified). If you want diff to use the latest generation of file2 instead, specify gen2 as 'latest'.


This method is used to propagate a change from a repository to its parent.


This method applies changes that have happened to the parent, to the repository. This will merge with any changes in the current repository.


Returns a list of all the repository objects.


Returns a repository element object for the given element.


Returns a repository object for the given path.


Set the storage type.




There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to or submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.

Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me.


  Original Author: Ivor Williams (RIP)          2002-2009
  Current Maintainer: Barbie <>  2014-2015


  Copyright (c) Ivor Williams, 2002-2009
  Copyright (c) Barbie,        2014-2015


This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.