NAME

VCS::Lite::Delta - VCS::Lite differences

SYNOPSIS

use VCS::Lite;

# diff

my $lit = VCS::Lite->new('/home/me/foo1.txt');
my $lit2 = VCS::Lite->new('/home/me/foo2.txt');
my $difftxt = $lit->delta($lit2)->diff;
print OUTFILE $difftxt;

# patch

my $delt = VCS::Lite::Delta->new('/home/me/patch.diff');
my $lit3 = $lit->patch($delt);
print OUTFILE $lit3->text;

# merge

my $lit4 = $lit->merge($lit->delta($lit2),$lit->delta($lit3));
print OUTFILE $lit4->text;

DESCRIPTION

This module provides a Delta class for the differencing functionality of VCS::Lite

new

The underlying object of VCS::Lite::Delta is an array of difference chunks such as that returned by Algorithm::Diff.

The constructor takes the following forms:

my $delt = VCS::Lite::Delta->new( '/my/file.diff',$sep); # File name
my $delt = VCS::Lite::Delta->new( \*FILE,$sep);	# File handle
my $delt = VCS::Lite::Delta->new( \$string,$sep); # String as scalar ref
my $delt = VCS::Lite::Delta->new( \@foo, $id1, $id2) # Array ref

$sep here is a regexp by which to split strings into tokens. The default is to use the natural perl mechanism of $/ (which is emulated when not reading from a file).

diff

print OUTFILE $delt->diff

This generates a standard diff format, for example:

4c4 < Now wherefore stopp'st thou me? --- > Now wherefore stoppest thou me?

COPYRIGHT

Copyright (c) Ivor Williams, 2003

LICENCE

You may use, modify and distribute this module under the same terms as Perl itself.

SEE ALSO

Algorithm::Diff.