|$object_id||This is a string to identify what is being diffed, patched or merged, in the applications environment. If there is no $source, this is used as a filename from which to read the content.|
This is an optional parameter, which can be used via $/ to split the input
file into tokens. The default is for lines of text. If you pass in a string
to be tokenized, this will use $sep as a regular expression
$separation can be a scalar or scalar ref, where this is used to break up the input stream. All values permitted for $/ are allowed (see perlvar).
$separation can also be a hashref, to give a finer level of control. For example:
in is the input record separator to use (the same as you would pass as $sep). Note that all values allowed for $/, and indeed the value of $/ passed in is what is used as a default. in can be a string or a regexp.
out is the character used on joining the members to output the results (text method in scalar context). This is the output record separator $\. Note that out defaults differently depening on the setting of chomp: if chomp is off, out will default to the empty string, or rather the passed in value of $\. If chomp is on, out will default to in - note that you should specify out explicitly if you are using a regexp for in.
If the chomp flag is set, the text matching in is removed from the input lines as they are read. chomp is not on by default, as this is new functionality in release 0.08.
if unspecified causes $object_id to be opened as a file and its
entire contents read in. The alternative is to supply $source, which can
be one of the following:
$lite->apply($lite2); $lite->apply($lite3, base => original);
This method call corresponds approximately to a version control systems check-in function. This causes $lite to be modified, so that its contents now reflect those of $lite2.
The VCS::Lite object passed in can also have its own original version. If this is the case, merging will be performed to incorporate the change as if it had come from a different branch. To facilitiate the merging process, optionally specify a base version, which can be the string original, contents (the default) or a VCS::Lite object whose contents will be used. This corresponds to the common ancestor in version control systems.
my $foo = $lite->text; my $bar = $lit2->text(|); my @baz = $lit3->text;
In scalar context, returns the equivalent of the file contents slurped (the optional separation parameter, defaulting to $_, is used to join the strings together). In list context, returns the list of lines or records.
my $fil = $lite->id
Returns the name associated with the VCS::Lite element when it was created by new. This is usually the file name.
my $delt = $lit->delta($lit2);
This is for backward compatibility with early versions. $lite->diff($lite2) is equivalent to $lite->delta($lite2)->diff.
my $lit3 = $lit->patch($delt);
my $lit4 = $lit->merge($lit1,$lit2,\&confl);
The third parameter to the method is a sub which is called whenever a merge conflict occurs. This needs to either resolve the conflict or insert the necessary text to highlight the conflict.
At the time of release there is one known bug within VCS-Lite:
Unfortunately Ivors original svn repository is no longer available, and any work which had done on fixing this bug has now been lost. As time allows I will review the examples and try to implement an appropriate solution.
If you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to firstname.lastname@example.org 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 <email@example.com> 2009-2015
Copyright (c) Ivor Williams, 2002-2006 Copyright (c) Barbie, 2009-2015
This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.
Colin Robertson for suggesting and providing patches for support of files with unterminated last lines.
|perl v5.20.3||VCS::LITE (3)||2015-01-17|