diff -Nru libvcs-lite-perl-0.08/Changes libvcs-lite-perl-0.09/Changes --- libvcs-lite-perl-0.08/Changes 2006-02-23 00:09:34.000000000 +0000 +++ libvcs-lite-perl-0.09/Changes 2009-08-17 20:09:18.000000000 +0100 @@ -1,39 +1,46 @@ Revision history for Perl extension VCS::Lite. -0.08 Wed Feb 22 2006 - - Rationalise end of line termination. Allow passing in a hashref for $sep - implement chomp mode. - - Add support for diff and patch of files with an unterminated last line. +0.09 17/08/2009 + - new maintainer, Barbie, due to the untimely death of Ivor Williams. + - updated documentation + - added more tests + +0.08 Wed Feb 22 2006 + - Rationalise end of line termination. Allow passing in a hashref for + $sep implement chomp mode. + - Add support for diff and patch of files with an unterminated last + line. -0.07 Sun Apr 03 2005 +0.07 Sun Apr 03 2005 - Fix script errors in vldiff.pl and vlpatch.pl - Lose the .pl in the script names. - Add apply method to VCS::Lite, which provides an anternative interface to merging. -0.06 Wed Dec 29 10:05:12 2004 +0.06 Wed Dec 29 10:05:12 2004 - Change underlying object type to be a hash. - Implement windowing of diffs. - Distribute vldiff,vlpatch and vlmerge as exe_files. -0.05 Sun Dec 14 15:00:16 2003 +0.05 Sun Dec 14 15:00:16 2003 - Resolve bugs reported on RT by removing merge method in VCS::Lite::Delta and references to it. Remove merge.t, keep merge1.t this eliminates the todo tests. - Provide and document API calls VCS::Lite->id, VCS::Lite::Delta->id and VCS::Lite::Delta->hunks. -0.04 Sun Apr 20 08:54:27 2003 +0.04 Sun Apr 20 08:54:27 2003 - Redesign of API - split of module into VCS::Lite and VCS::Lite::Delta - vldiff.pl, vlpatch.pl and vlmerge.pl scripts included in kit - udiff (diff -u) capability added - merge using new api incomplete (old merge still available) -0.03 Patched version supplied by Reuben Thomas +0.03 00/00/0000 + - Patched version supplied by Reuben Thomas -0.02 Wed Dec 18 16:05:23 2002 +0.02 Wed Dec 18 16:05:23 2002 - Original manifest was incomplete. This was uploaded to PAUSE -0.01 Mon Dec 16 14:03:18 2002 +0.01 Mon Dec 16 14:03:18 2002 - original version; created by h2xs 1.21 with options -AX -n VCS::Lite diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/debian/changelog /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/debian/changelog --- libvcs-lite-perl-0.08/debian/changelog 2009-11-10 09:48:13.000000000 +0000 +++ libvcs-lite-perl-0.09/debian/changelog 2009-11-10 09:48:13.000000000 +0000 @@ -1,3 +1,12 @@ +libvcs-lite-perl (0.09-1) unstable; urgency=low + + * New upstream release + * Update Standards-Version (no changes) + * Move to debhelper 5 compatibility + * Update copyright file to reflect new maintainership (RIP Ivor) + + -- Dominic Hargreaves Sun, 25 Oct 2009 15:54:54 +0000 + libvcs-lite-perl (0.08-2) unstable; urgency=low * Fix debian/rules rmdir bug (closes: #467931) diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/debian/compat /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/debian/compat --- libvcs-lite-perl-0.08/debian/compat 2009-11-10 09:48:13.000000000 +0000 +++ libvcs-lite-perl-0.09/debian/compat 2009-11-10 09:48:13.000000000 +0000 @@ -1 +1 @@ -4 +5 diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/debian/control /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/debian/control --- libvcs-lite-perl-0.08/debian/control 2009-11-10 09:48:13.000000000 +0000 +++ libvcs-lite-perl-0.09/debian/control 2009-11-10 09:48:13.000000000 +0000 @@ -1,10 +1,10 @@ Source: libvcs-lite-perl Section: perl Priority: optional -Build-Depends: debhelper (>= 4.0.2) +Build-Depends: debhelper (>= 5) Build-Depends-Indep: perl (>= 5.8.0-7), libalgorithm-diff-perl (>= 1.13) Maintainer: Dominic Hargreaves -Standards-Version: 3.7.3 +Standards-Version: 3.8.3 Homepage: http://search.cpan.org/dist/VCS-Lite/ Package: libvcs-lite-perl diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/debian/copyright /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/debian/copyright --- libvcs-lite-perl-0.08/debian/copyright 2009-11-10 09:48:13.000000000 +0000 +++ libvcs-lite-perl-0.09/debian/copyright 2009-11-10 09:48:13.000000000 +0000 @@ -3,7 +3,8 @@ It was downloaded from CPAN . -Copyright (c) Ivor Williams, 2002-2003 +Copyright (C) 2003-2006 Ivor Williams +Copyright (C) 2009 Barbie This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/lib/VCS/Lite/Delta.pm /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/lib/VCS/Lite/Delta.pm --- libvcs-lite-perl-0.08/lib/VCS/Lite/Delta.pm 2006-02-23 00:08:46.000000000 +0000 +++ libvcs-lite-perl-0.09/lib/VCS/Lite/Delta.pm 2009-08-17 20:09:18.000000000 +0100 @@ -2,7 +2,9 @@ use strict; use warnings; -our $VERSION = '0.04'; +our $VERSION = '0.09'; + +#---------------------------------------------------------------------------- =head1 NAME @@ -30,89 +32,26 @@ This module provides a Delta class for the differencing functionality of VCS::Lite -=head2 new - -The underlying object of VCS::Lite::Delta is an array of difference -chunks (hunks) 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). The arrayref form is assuming an array of -hunks such as the output from L. - -The other forms assume the input is the text form of a diff listing, -either in diff format, or in unified format. The input is parsed, and errors -are reported. - -=head2 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? - -=head2 udiff - - print OUTFILE $delt->udiff - -This generates a unified diff (like diff -u) similar to the form in which -patches are submitted. - -=head2 id - - my ($id1,$id2) = $delt->id; - $delt2->id('foo.pl@@1','foo.pl@@3') - -The I method allows get and set of the names associated with the two -elements being diffed. The id is set for delta objects returned by -VCS::Lite->diff, to the element IDs of the VCS::Lite objects being diffed. - -Diff format omits the file names, hence the IDs will not be populated by -new. This is not the case with diff -u format, which includes the file -names which are passed in and available as IDs. - -=head2 hunks - - my @hunklist = $delt->hunks - -A hunk is a technical term for a section of input containing a difference. -Each hunk is an arrayref, containing the block of lines. Each line is -itself an arrayref, for example: - - [ - [ '+', 9, 'use Acme::Foo;'], - [ '-', 9, 'use Acme::Bar;'], - ] - -See the documentation on L for more details of this structure. - -=head1 COPYRIGHT +=cut -Copyright (c) Ivor Williams, 2003-2006 +#---------------------------------------------------------------------------- -=head1 LICENCE +############################################################################# +#Library Modules # +############################################################################# -You may use, modify and distribute this module under the same terms -as Perl itself. +use Carp; -=head1 SEE ALSO +#---------------------------------------------------------------------------- -L. +# Error handling, use package vars to control it for now. +use vars qw($error_action $error_msg $error_line); -=cut +#---------------------------------------------------------------------------- -use Carp; +############################################################################# +#Interface Methods # +############################################################################# sub new { my $class = shift; @@ -346,10 +285,6 @@ }, $class; } -# Error handling, use package vars to control it for now. - -use vars qw($error_action $error_msg $error_line); - sub _error { ( $error_line, my $msg ) = @_; @@ -534,3 +469,111 @@ } 1; + +__END__ + +#---------------------------------------------------------------------------- + +=head1 API + +=head2 new + +The underlying object of VCS::Lite::Delta is an array of difference +chunks (hunks) 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). The arrayref form is assuming an array of +hunks such as the output from L. + +The other forms assume the input is the text form of a diff listing, +either in diff format, or in unified format. The input is parsed, and errors +are reported. + +=head2 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? + +=head2 udiff + + print OUTFILE $delt->udiff + +This generates a unified diff (like diff -u) similar to the form in which +patches are submitted. + +=head2 id + + my ($id1,$id2) = $delt->id; + $delt2->id('foo.pl@@1','foo.pl@@3') + +The I method allows get and set of the names associated with the two +elements being diffed. The id is set for delta objects returned by +VCS::Lite->diff, to the element IDs of the VCS::Lite objects being diffed. + +Diff format omits the file names, hence the IDs will not be populated by +new. This is not the case with diff -u format, which includes the file +names which are passed in and available as IDs. + +=head2 hunks + + my @hunklist = $delt->hunks + +A hunk is a technical term for a section of input containing a difference. +Each hunk is an arrayref, containing the block of lines. Each line is +itself an arrayref, for example: + + [ + [ '+', 9, 'use Acme::Foo;'], + [ '-', 9, 'use Acme::Bar;'], + ] + +See the documentation on L for more details of this structure. + +=head1 BUGS, PATCHES & FIXES + +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 barbie@cpan.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. + +http://rt.cpan.org/Public/Dist/Display.html?Name=VCS-Lite + +Fixes are dependant upon their severity and my availablity. Should a fix not +be forthcoming, please feel free to (politely) remind me. + +=head1 AUTHOR + + Original Author: Ivor Williams (RIP) 2008-2009 + Current Maintainer: Barbie 2009 + +=head1 COPYRIGHT + + Copyright (c) Ivor Williams, 2002-2006 + Copyright (c) Barbie, 2009 + +=head1 LICENCE + +You may use, modify and distribute this module under the same terms +as Perl itself. + +=head1 SEE ALSO + +L. + +=cut + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/lib/VCS/Lite.pm /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/lib/VCS/Lite.pm --- libvcs-lite-perl-0.08/lib/VCS/Lite.pm 2006-02-23 00:13:00.000000000 +0000 +++ libvcs-lite-perl-0.09/lib/VCS/Lite.pm 2009-08-17 20:09:18.000000000 +0100 @@ -2,7 +2,9 @@ use strict; use warnings; -our $VERSION = '0.08'; +our $VERSION = '0.09'; + +#---------------------------------------------------------------------------- =head1 NAME @@ -40,191 +42,23 @@ It makes use of the module Algorithm::Diff. It provides the facility for basic diffing, patching and merging. -=head2 new - -The underlying storage concept of VCS::Lite is an array. The members -of the array can be anything that a scalar can represent (including -references to structures and objects). The default is for the object -to hold an array of scalars as strings corresponding to lines of text. - -The basic form of the constructor is as follows: - - my $lite = VCS::Lite->new( '/my/file'); - -which slurps the file to make an object. The full form is as follows: - - my $lite = VCS::Lite->new( $object_id, $separation, $source, ...); - -=over 4 - -=item C<$object_id> - -This is a string to identify what is being diffed, patched or -merged, in the application's environment. If there is no $source, this -is used as a filename from which to read the content. - -=item C<$separation> - -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 L). - -$separation can also be a hashref, to give a finer level of control. For example: - - { in => '\n', - out => '\n', - chomp => 1 } - -'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. - -=item C<$source> - -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: - -=over 4 - -=item C - -This is a string which is tokenized using $separation - -=item C - -Array of tokens - -=item C or C - -Contents of file are slurped - -=item C - -This is called successively to obtain tokens until received undef. - -=back - -=back - -In the Perl spirit of DWIM, new assumes that given an arrayref, you -have already done all the work of making your list of whatevers. Given -a string (filename) or a file handle, the file is slurped, reading -each line of text into a member of the array. Given a callback, the -routine is called successively with arguments $p1, $p2, etc. and is -expected to return a scalar which is added (pushed on) to the array. - -=head2 apply - - $lite->apply($lite2); - $lite->apply($lite3, base => 'original'); - -This method call corresponds approximately to a version control system's -check-in function. This causes $lite to be modified, so that its contents -now reflect those of $lite2. - -$lite does retain the original contents, available via L. However, -unlike in a version control system, the object holds only the first original -and latest contents. - -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. - -=head2 original - -This returns a VCS::Lite object for the original version, before changes were -applied with apply. - -=head2 text - - 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. - -=head2 id - - 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. - -=head2 delta - - my $delt = $lit->delta($lit2); - -Perform the difference between two VCS::Lite objects. This object returns -a L object. - -=head2 diff - -This is for backward compatibility with early versions. $lite->diff($lite2) is -equivalent to $lite->delta($lite2)->diff. - -=head2 patch - - my $lit3 = $lit->patch($delt); - -Applies a patch to a VCS::Lite object. Accepts a file handle or file -name string. Reads the file in diff format, and applies it. Returns a -VCS::Lite object for the patched source. - -=head2 merge - - my $lit4 = $lit->merge($lit1,$lit2,\&confl); - -Performs the "parallelogram of merging". This applies two different -change streams represented by VCS::Lite objects. Returns a VCS::Lite -object with both sets of changes merged. - -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. - -=head1 COPYRIGHT - -Copyright (c) Ivor Williams, 2002-2006 - -=head1 LICENCE - -You may use, modify and distribute this module under the same terms -as Perl itself. - -=head1 ACKNOWLEDGEMENTS - -Colin Robertson for suggesting and providing patches for support of -files with unterminated last lines. - -=head1 SEE ALSO +=cut -L. +#---------------------------------------------------------------------------- -=cut +############################################################################# +#Library Modules # +############################################################################# use Carp; use Algorithm::Diff qw(traverse_sequences); +use VCS::Lite::Delta; + +#---------------------------------------------------------------------------- + +############################################################################# +#Interface Methods # +############################################################################# sub new { my ($class,$id,$sep,$src,@args) = @_; @@ -334,8 +168,6 @@ @_ ? ($self->{id} = shift) : $self->{id}; } -use VCS::Lite::Delta; - sub delta { my $lite1 = shift; my $lite2 = shift; @@ -422,21 +254,19 @@ },\@out); } - # Equality of two array references (contents) +# Equality of two array references (contents) - sub _equal - { - my ($a,$b) = @_; +sub _equal { + my ($a,$b) = @_; - return 0 if @$a != @$b; + return 0 if @$a != @$b; - foreach (0..$#$a) - { - return 0 if $a->[$_] ne $b->[$_]; - } - - 1; + foreach (0..$#$a) { + return 0 if $a->[$_] ne $b->[$_]; } + + 1; +} sub merge { my ($self,$d1,$d2) = @_; @@ -584,3 +414,218 @@ sub _error {}; 1; + +__END__ + +#---------------------------------------------------------------------------- + +=head1 API + +=head2 new + +The underlying storage concept of VCS::Lite is an array. The members +of the array can be anything that a scalar can represent (including +references to structures and objects). The default is for the object +to hold an array of scalars as strings corresponding to lines of text. + +The basic form of the constructor is as follows: + + my $lite = VCS::Lite->new( '/my/file'); + +which slurps the file to make an object. The full form is as follows: + + my $lite = VCS::Lite->new( $object_id, $separation, $source, ...); + +=over 4 + +=item C<$object_id> + +This is a string to identify what is being diffed, patched or +merged, in the application's environment. If there is no $source, this +is used as a filename from which to read the content. + +=item C<$separation> + +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 L). + +$separation can also be a hashref, to give a finer level of control. For example: + + { in => '\n', + out => '\n', + chomp => 1 } + +'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. + +=item C<$source> + +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: + +=over 4 + +=item C + +This is a string which is tokenized using $separation + +=item C + +Array of tokens + +=item C or C + +Contents of file are slurped + +=item C + +This is called successively to obtain tokens until received undef. + +=back + +=back + +In the Perl spirit of DWIM, new assumes that given an arrayref, you +have already done all the work of making your list of whatevers. Given +a string (filename) or a file handle, the file is slurped, reading +each line of text into a member of the array. Given a callback, the +routine is called successively with arguments $p1, $p2, etc. and is +expected to return a scalar which is added (pushed on) to the array. + +=head2 apply + + $lite->apply($lite2); + $lite->apply($lite3, base => 'original'); + +This method call corresponds approximately to a version control system's +check-in function. This causes $lite to be modified, so that its contents +now reflect those of $lite2. + +$lite does retain the original contents, available via L. However, +unlike in a version control system, the object holds only the first original +and latest contents. + +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. + +=head2 original + +This returns a VCS::Lite object for the original version, before changes were +applied with apply. + +=head2 text + + 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. + +=head2 id + + 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. + +=head2 delta + + my $delt = $lit->delta($lit2); + +Perform the difference between two VCS::Lite objects. This object returns +a L object. + +=head2 diff + +This is for backward compatibility with early versions. $lite->diff($lite2) is +equivalent to $lite->delta($lite2)->diff. + +=head2 patch + + my $lit3 = $lit->patch($delt); + +Applies a patch to a VCS::Lite object. Accepts a file handle or file +name string. Reads the file in diff format, and applies it. Returns a +VCS::Lite object for the patched source. + +=head2 merge + + my $lit4 = $lit->merge($lit1,$lit2,\&confl); + +Performs the "parallelogram of merging". This applies two different +change streams represented by VCS::Lite objects. Returns a VCS::Lite +object with both sets of changes merged. + +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. + +=head1 BUGS, PATCHES & FIXES + +At the time of release there is one known bug within VCS-Lite: + +http://rt.cpan.org/Public/Bug/Display.html?id=20738 + +Unfortunately Ivor's 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 barbie@cpan.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. + +http://rt.cpan.org/Public/Dist/Display.html?Name=VCS-Lite + +Fixes are dependant upon their severity and my availablity. Should a fix not +be forthcoming, please feel free to (politely) remind me. + +=head1 AUTHOR + + Original Author: Ivor Williams (RIP) 2008-2009 + Current Maintainer: Barbie 2009 + +=head1 COPYRIGHT + + Copyright (c) Ivor Williams, 2002-2006 + Copyright (c) Barbie, 2009 + +=head1 LICENCE + +You may use, modify and distribute this module under the same terms +as Perl itself. + +=head1 ACKNOWLEDGEMENTS + +Colin Robertson for suggesting and providing patches for support of +files with unterminated last lines. + +=head1 SEE ALSO + +L. + +=cut diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/Makefile.PL /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/Makefile.PL --- libvcs-lite-perl-0.08/Makefile.PL 2005-04-03 12:14:21.000000000 +0100 +++ libvcs-lite-perl-0.09/Makefile.PL 2009-08-17 20:09:18.000000000 +0100 @@ -1,12 +1,17 @@ use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. + WriteMakefile( - NAME => 'VCS::Lite', + NAME => 'VCS::Lite', VERSION_FROM => 'lib/VCS/Lite.pm', - PREREQ_PM => {Algorithm::Diff => 1.13}, + PREREQ_PM => { + Algorithm::Diff => 1.13, + Carp => 0, + + Getopt::Long => 0 # required by installed scripts + }, ABSTRACT_FROM => 'lib/VCS/Lite.pm', - AUTHOR => 'Ivor Williams ', + AUTHOR => 'Barbie ', EXE_FILES => [qw( scripts/vldiff scripts/vlpatch scripts/vlmerge)], + NO_META => 1, ); diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/MANIFEST /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/MANIFEST --- libvcs-lite-perl-0.08/MANIFEST 2005-10-05 23:18:15.000000000 +0100 +++ libvcs-lite-perl-0.09/MANIFEST 2009-08-17 20:09:18.000000000 +0100 @@ -1,8 +1,4 @@ Changes -Makefile.PL -MANIFEST -META.yml -README data/mariner.txt data/marinerx.dif data/marinerx.txt @@ -13,17 +9,24 @@ data/marinery.txt data/marinerz.txt data/snarka.txt -data/snarkb.txt data/snarkab.dif data/snarkab.udif +data/snarkb.txt lib/VCS/Lite.pm lib/VCS/Lite/Delta.pm +Makefile.PL +MANIFEST +META.yml +README scripts/vldiff scripts/vlmerge scripts/vlpatch -t/diff.t -t/merge.t -t/merge1.t -t/patch.t -t/pod.t -t/pod_coverage.t +t/01load.t +t/10diff.t +t/20merge.t +t/21merge.t +t/30patch.t +t/90podtest.t +t/91podcover.t +t/94metatest.t +t/95changedate.t diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/META.yml /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/META.yml --- libvcs-lite-perl-0.08/META.yml 2006-02-23 00:14:20.000000000 +0000 +++ libvcs-lite-perl-0.09/META.yml 2009-08-17 20:09:18.000000000 +0100 @@ -1,11 +1,36 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: VCS-Lite -version: 0.08 -version_from: lib/VCS/Lite.pm -installdirs: site +--- #YAML:1.0 +name: VCS-Lite +version: 0.09 +abstract: TT wrapper for Text::WikiFormat +distribution_type: module +installdirs: site +license: perl +author: + - Barbie (barbie@cpan.org) + requires: - Algorithm::Diff: 1.13 + Algorithm::Diff: 1.13 + Carp: 0 + Getopt::Long: 0 +recommends: + Test::More: 0.45 + Test::Pod: 1.00 + Test::Pod::Coverage: 0.08 + Test::CPAN::Meta: 0.12 +build_requires: + Test::More: 0.45 + +provides: + VCS::Lite: + file: lib/VCS/Lite.pm + version: 0.09 +no_index: + directory: + - t + - examples + +meta-spec: + version: 1.4 + url: http://module-build.sourceforge.net/META-spec-v1.4.html +generated_by: Hand 1.0 -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.17 diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/README /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/README --- libvcs-lite-perl-0.08/README 2006-02-23 00:12:30.000000000 +0000 +++ libvcs-lite-perl-0.09/README 2009-08-17 20:09:18.000000000 +0100 @@ -29,6 +29,7 @@ COPYRIGHT AND LICENCE Copyright (C) 2003-2006 Ivor Williams +Copyright (C) 2009 Barbie This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/01load.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/01load.t --- libvcs-lite-perl-0.08/t/01load.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/01load.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,10 @@ +#!/usr/bin/perl -w +use strict; + +use Test::More tests => 2; + +BEGIN { + use_ok( 'VCS::Lite' ); + use_ok( 'VCS::Lite::Delta' ); +} + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/10diff.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/10diff.t --- libvcs-lite-perl-0.08/t/10diff.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/10diff.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,159 @@ + +use strict; +use Test::More tests => 17; +use VCS::Lite; + +my $save_output = $ENV{VCS_LITE_KEEP_OUTPUT}; + +my $el1 = VCS::Lite->new('data/mariner.txt'); + +#01 +isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); + +#02 +is($el1->id,'data/mariner.txt','Correct name returned by id'); + +my $el2 = VCS::Lite->new('data/marinerx.txt'); + +#03 +ok(!$el1->delta($el1),'Compare with same returns empty array'); + +my $dt1 = $el1->delta($el2); + +#04 +isa_ok($dt1,'VCS::Lite::Delta','Delta return'); + +#05 +my @id = $dt1->id; +is_deeply(\@id,['data/mariner.txt', + 'data/marinerx.txt'], + 'id method of delta returns correct ids'); + +#06 +my @hunks = $dt1->hunks; +is_deeply(\@hunks, + [ + [ + ['-', 3, "Now wherefore stopp'st thou me?\n"], + ['+', 3, "Now wherefore stoppest thou me?\n"], + ],[ + ['-', 20, "The Wedding-Guest sat on a stone:\n"], + ['-', 21, "He cannot chuse but hear;\n"], + ['-', 22, "And thus spake on that ancient man,\n"], + ['-', 23, "The bright-eyed Mariner.\n"], + ['-', 24, "\n"], + ],[ + ['+', 32, "Wondering about the wretched loon\n"], + ],[ + ['-', 94, "Whiles all the night, through fog-smoke white,\n"], + ['-', 95, "Glimmered the white Moon-shine.\n"], + ['+', 90, "While all the night, through fog-smoke white,\n"], + ['+', 91, "Glimmered the white Moonshine.\n"], + ] + ], 'Full comparison of hunks'); + +my $diff = $dt1->diff; + +#07 +ok($diff, 'Diff returns differences'); + +if ($save_output) { + open (my $dfh, '>', 'diff1.out') + or die "Failed to write output: $!"; + print $dfh $diff; +} + +my $results = do { local (@ARGV, $/) = 'data/marinerx.dif'; <> }; + +#08 +is($diff, $results, 'Diff matches expected results (diff)'); + +my $el1c = VCS::Lite->new('data/mariner.txt', { chomp => 1 } ); +my $el2c = VCS::Lite->new('data/marinerx.txt', { chomp => 1 } ); +my $dt1c = $el1c->delta($el2c); +$diff = $dt1c->diff; + +if ($save_output) { + open (my $dfh, '>', 'diff1c.out') + or die "Failed to write output: $!"; + print $dfh $diff; +} + +#09 +is($diff, $results, 'Chomped mode: diff matches expected results'); + +my $el3 = VCS::Lite->new('data/marinery.txt'); +$diff = $el1->diff($el3); # old form of call + +#10 +ok($diff, 'Diff returns differences'); + +if ($save_output) { + open (my $dfh, '>', 'diff2.out') + or die "Failed to write output: $!"; + print $dfh $diff; +} + +$results = do { local (@ARGV, $/) = 'data/marinery.dif'; <> }; + +#11 +is($diff, $results, 'Diff matches expected results (diff)'); + +my $udiff = $dt1->udiff; + +#12 +ok($udiff, 'udiff returns differences'); + +if ($save_output) { + open (my $dfh, '>', 'diff3.out') + or die "Failed to write output: $!"; + print $dfh $udiff; +} + +$results = do { local (@ARGV, $/) = 'data/marinerx1.udif'; <> }; + +#13 +is($udiff, $results, 'Diff matches expected results (udiff)'); + +$dt1 = $el1->delta($el2, window => 3); +$udiff = $dt1->udiff; + +$results = do { local (@ARGV, $/) = 'data/marinerx.udif'; <> }; + +#14 +is($udiff, $results, 'Diff matches expected results (udiff, 3 window)'); + +$dt1c = $el1c->delta($el2c, window => 3); +$udiff = $dt1c->udiff; + +#15 +is($udiff, $results, 'Chomped diff matches expected results (udiff, 3 window)'); + +if ($save_output) { + open (my $dfh, '>', 'diff4.out') + or die "Failed to write output: $!"; + print $dfh $udiff; +} + +#Test with no newline at end of file +my $el4 = VCS::Lite->new('data/snarka.txt'); +my $el5 = VCS::Lite->new('data/snarkb.txt'); +my $dt2 = $el4->delta($el5); + +$results = do { local (@ARGV, $/) = 'data/snarkab.dif'; <> }; +$diff = $dt2->diff; + +#16 +is($diff, $results, 'Diff matches expected results (diff)'); + +$results = do { local (@ARGV, $/) = 'data/snarkab.udif'; <> }; +$udiff = $dt2->udiff; + +#17 +is($udiff, $results, 'Diff matches expected results (udiff)'); + +if ($save_output) { + open (my $dfh, '>', 'diff5.out') + or die "Failed to write output: $!"; + print $dfh $udiff; +} diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/20merge.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/20merge.t --- libvcs-lite-perl-0.08/t/20merge.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/20merge.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,43 @@ + +use strict; +use Test::More tests => 4; +use VCS::Lite; + +my $el1 = VCS::Lite->new('data/mariner.txt'); + +#01 +isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); + +my $el2 = VCS::Lite->new('data/marinerx.txt'); +my $el3 = VCS::Lite->new('data/marinery.txt'); + +my $el4 = $el1->merge($el2,$el3); + +#02 +isa_ok($el4,'VCS::Lite','Return from merge method'); + +my $merged = $el4->text; + +#Uncomment for debugging +#open MERGE,'>merge1.out'; +#print MERGE $merged; +#close MERGE; + +my $results = do { local (@ARGV, $/) = 'data/marinerxy.txt'; <> }; # slurp entire file + +#03 +is($merged, $results, 'Merge matches expected results'); + +$el3 = VCS::Lite->new('data/marinerz.txt'); + +$el4 = $el1->merge($el2,$el3); +$merged = $el4->text; + +#04 +isa_ok($el4,'VCS::Lite','merge returns'); + +#Uncomment for debugging +#open MERGE,'>merge2.out'; +#print MERGE $merged; +#close MERGE; + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/21merge.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/21merge.t --- libvcs-lite-perl-0.08/t/21merge.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/21merge.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,42 @@ + +use strict; +use Test::More tests => 5; +use VCS::Lite; + +my $el1 = VCS::Lite->new('data/mariner.txt'); + +#01 +isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); + +my $el2 = VCS::Lite->new('data/marinerx.txt'); +my $el3 = VCS::Lite->new('data/marinery.txt'); + +$el1->apply($el2); + +#02 +ok(!$el1->delta($el2), "Not different once applied"); + +my $el1a = $el1->original; + +#03 +ok($el1->delta($el1a), "but different from original"); + +#04 +isa_ok($el1a,'VCS::Lite','Return from original'); + +$el1a->apply($el3); +$el1->apply($el1a, base => 'original'); + +my $merged = $el1->text; + +#Uncomment for debugging +open MERGE,'>merge1.out'; +print MERGE $merged; +close MERGE; + +my $results = do { local (@ARGV, $/) = 'data/marinerxy.txt'; <> }; # slurp entire file + +#05 +is($merged, $results, 'Merge matches expected results'); + + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/30patch.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/30patch.t --- libvcs-lite-perl-0.08/t/30patch.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/30patch.t 2009-08-17 20:09:18.000000000 +0100 @@ -0,0 +1,150 @@ + +use strict; +use Test::More tests => 19; +use VCS::Lite; + +my $save_output = $ENV{VCS_LITE_KEEP_OUTPUT}; + +my $el1 = VCS::Lite->new('data/mariner.txt'); + +#01 +isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); + +my $el2 = VCS::Lite->new('data/marinerx.txt'); +my $dt1 = VCS::Lite::Delta->new('data/marinerx.dif',undef,'mariner.txt','marinerx.txt'); + +#02 +isa_ok($dt1,'VCS::Lite::Delta','New delta'); + +my $el3 = $el1->patch($dt1); + +#03 +isa_ok($el3,'VCS::Lite','Return from patch method'); + +my $out2 = $el2->text; +my $out3 = $el3->text; + +if ($save_output) { + open (my $dfh, '>', 'patch1.out') + or die "Failed to write output: $!"; + print $dfh $out3; +} + +#04 +is($out2, $out3, 'Patched file is the same as marinerx'); + +my $dt2 = VCS::Lite::Delta->new('data/marinerx.udif',undef,'mariner.txt','marinerx.txt'); + +#05 +isa_ok($dt2,'VCS::Lite::Delta','New delta'); + +my $el4 = $el1->patch($dt2); + +#06 +isa_ok($el4,'VCS::Lite','Patch applied'); + +my $out4 = $el4->text; + +#07 +is($out2, $out4, 'Patched file is the same as marinerx'); + +my $el1c = VCS::Lite->new('data/mariner.txt', {chomp => 1}); +my $el2c = VCS::Lite->new('data/marinerx.txt', {chomp => 1}); +my $dt1c = VCS::Lite::Delta->new('data/marinerx.dif',{chomp => 1}, + 'mariner.txt','marinerx.txt'); + +#08 +isa_ok($dt1c,'VCS::Lite::Delta','New delta (chomped)'); + +my $el3c = $el1c->patch($dt1c); + +#09 +isa_ok($el3c,'VCS::Lite','Return from patch method (chomped)'); + +$out2 = $el2c->text; +$out3 = $el3c->text; + +if ($save_output) { + open (my $dfh, '>', 'patch1c.out') + or die "Failed to write output: $!"; + print $dfh $out3; +} + +#10 +is($out2, $out3, 'Patched file is the same as marinerx'); + +my $dt2c = VCS::Lite::Delta->new('data/marinerx.udif',{chomp => 1}, + 'mariner.txt','marinerx.txt'); + +#11 +isa_ok($dt2c,'VCS::Lite::Delta','New delta'); + +my $el4c = $el1c->patch($dt2c); + +#12 +isa_ok($el4c,'VCS::Lite','Patch applied'); + +$out4 = $el4c->text; + +#13 +is($out2, $out4, 'Patched file is the same as marinerx (chomped)'); + +my $udiff = $dt2->udiff; + +#14 +ok($udiff, "udiff returns text"); + +if ($save_output) { + open (my $dfh, '>', 'patch2.out') + or die "Failed to write output: $!"; + print $dfh $udiff; +} + +my $results = do { local (@ARGV, $/) = 'data/marinerx.udif'; <> }; # slurp entire file + +$results =~ s/^\+\+\+.*\n//s; +$results =~ s/^---.*\n//s; +$udiff =~ s/^\+\+\+.*\n//s; +$udiff =~ s/^---.*\n//s; + +#15 +is($udiff,$results,'udiff output matches original udiff'); + +$udiff = $dt2c->udiff; + +#16 +ok($udiff, "udiff returns text (chomped)"); + +if ($save_output) { + open (my $dfh, '>', 'patch2c.out') + or die "Failed to write output: $!"; + print $dfh $udiff; +} + +$udiff =~ s/^\+\+\+.*\n//s; +$udiff =~ s/^---.*\n//s; + +#17 +is($udiff,$results,'udiff output matches original udiff'); + + +my $el5 = VCS::Lite->new('data/snarka.txt'); +my $el6 = VCS::Lite->new('data/snarkb.txt'); +my $dt3 = VCS::Lite::Delta->new('data/snarkab.dif',undef,'snarka.txt','snarkb.txt'); +my $el7 = $el5->patch($dt3); + +my $out6 = $el6->text; +my $out7 = $el7->text; + +#16 +is($out6, $out7, 'Patched file is the same as snarkb (diff)'); + +my $dt4 = VCS::Lite::Delta->new('data/snarkab.udif',undef,'snarka.txt','snarkb.txt'); +my $el8 = $el5->patch($dt4); + +$out7 = $el7->text; +my $out8 = $el8->text; + +#17 +is($out6, $out8, 'Patched file is the same as snarkb (udiff)'); + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/90podtest.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/90podtest.t --- libvcs-lite-perl-0.08/t/90podtest.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/90podtest.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,10 @@ +use Test::More; + +# Skip if doing a regular install +plan skip_all => "Author tests not required for installation" + unless ( $ENV{AUTOMATED_TESTING} ); + +eval "use Test::Pod 1.00"; +plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; +all_pod_files_ok(); + diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/91podcover.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/91podcover.t --- libvcs-lite-perl-0.08/t/91podcover.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/91podcover.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,9 @@ +use Test::More; + +# Skip if doing a regular install +plan skip_all => "Author tests not required for installation" + unless ( $ENV{AUTOMATED_TESTING} ); + +eval "use Test::Pod::Coverage 0.08"; +plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD coverage" if $@; +all_pod_coverage_ok(); diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/94metatest.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/94metatest.t --- libvcs-lite-perl-0.08/t/94metatest.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/94metatest.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,25 @@ +use Test::More; + +# Skip if doing a regular install +plan skip_all => "Author tests not required for installation" + unless ( $ENV{AUTOMATED_TESTING} ); + +eval "use Test::CPAN::Meta"; +plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; + +plan no_plan; + +my $meta = meta_spec_ok(undef,undef,@_); + +use VCS::Lite; +my $version = $VCS::Lite::VERSION; + +is($meta->{version},$version, + 'META.yml distribution version matches'); + +if($meta->{provides}) { + for my $mod (keys %{$meta->{provides}}) { + is($meta->{provides}{$mod}{version},$version, + "META.yml entry [$mod] version matches"); + } +} diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/95changedate.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/95changedate.t --- libvcs-lite-perl-0.08/t/95changedate.t 1970-01-01 01:00:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/95changedate.t 2009-08-17 20:09:19.000000000 +0100 @@ -0,0 +1,20 @@ +use Test::More; +use IO::File; +use VCS::Lite; + +# Skip if doing a regular install +plan skip_all => "Author tests not required for installation" + unless ( $ENV{AUTOMATED_TESTING} ); + +my $fh = IO::File->new('Changes','r') or plan skip_all => "Cannot open Changes file"; + +plan no_plan; + +my $latest = 0; +while(<$fh>) { + next unless(m!^\d!); + $latest = 1 if(m!^$VCS::Lite::VERSION!); + like($_, qr!\d[\d._]+\s+(\d{2}/\d{2}/\d{4}|\w{3} \w{3} \d{2} \d{4}|\w{3} \w{3} \d{2} \d{2}:\d{2}:\d{2} \d{4})!,'... version has a datestamp'); +} + +is($latest,1,'... latest version not listed'); diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/diff.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/diff.t --- libvcs-lite-perl-0.08/t/diff.t 2006-02-22 22:50:13.000000000 +0000 +++ libvcs-lite-perl-0.09/t/diff.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,159 +0,0 @@ - -use strict; -use Test::More tests => 17; -use VCS::Lite; - -my $save_output = $ENV{VCS_LITE_KEEP_OUTPUT}; - -my $el1 = VCS::Lite->new('data/mariner.txt'); - -#01 -isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); - -#02 -is($el1->id,'data/mariner.txt','Correct name returned by id'); - -my $el2 = VCS::Lite->new('data/marinerx.txt'); - -#03 -ok(!$el1->delta($el1),'Compare with same returns empty array'); - -my $dt1 = $el1->delta($el2); - -#04 -isa_ok($dt1,'VCS::Lite::Delta','Delta return'); - -#05 -my @id = $dt1->id; -is_deeply(\@id,['data/mariner.txt', - 'data/marinerx.txt'], - 'id method of delta returns correct ids'); - -#06 -my @hunks = $dt1->hunks; -is_deeply(\@hunks, - [ - [ - ['-', 3, "Now wherefore stopp'st thou me?\n"], - ['+', 3, "Now wherefore stoppest thou me?\n"], - ],[ - ['-', 20, "The Wedding-Guest sat on a stone:\n"], - ['-', 21, "He cannot chuse but hear;\n"], - ['-', 22, "And thus spake on that ancient man,\n"], - ['-', 23, "The bright-eyed Mariner.\n"], - ['-', 24, "\n"], - ],[ - ['+', 32, "Wondering about the wretched loon\n"], - ],[ - ['-', 94, "Whiles all the night, through fog-smoke white,\n"], - ['-', 95, "Glimmered the white Moon-shine.\n"], - ['+', 90, "While all the night, through fog-smoke white,\n"], - ['+', 91, "Glimmered the white Moonshine.\n"], - ] - ], 'Full comparison of hunks'); - -my $diff = $dt1->diff; - -#07 -ok($diff, 'Diff returns differences'); - -if ($save_output) { - open (my $dfh, '>', 'diff1.out') - or die "Failed to write output: $!"; - print $dfh $diff; -} - -my $results = do { local (@ARGV, $/) = 'data/marinerx.dif'; <> }; - -#08 -is($diff, $results, 'Diff matches expected results (diff)'); - -my $el1c = VCS::Lite->new('data/mariner.txt', { chomp => 1 } ); -my $el2c = VCS::Lite->new('data/marinerx.txt', { chomp => 1 } ); -my $dt1c = $el1c->delta($el2c); -$diff = $dt1c->diff; - -if ($save_output) { - open (my $dfh, '>', 'diff1c.out') - or die "Failed to write output: $!"; - print $dfh $diff; -} - -#09 -is($diff, $results, 'Chomped mode: diff matches expected results'); - -my $el3 = VCS::Lite->new('data/marinery.txt'); -$diff = $el1->diff($el3); # old form of call - -#10 -ok($diff, 'Diff returns differences'); - -if ($save_output) { - open (my $dfh, '>', 'diff2.out') - or die "Failed to write output: $!"; - print $dfh $diff; -} - -$results = do { local (@ARGV, $/) = 'data/marinery.dif'; <> }; - -#11 -is($diff, $results, 'Diff matches expected results (diff)'); - -my $udiff = $dt1->udiff; - -#12 -ok($udiff, 'udiff returns differences'); - -if ($save_output) { - open (my $dfh, '>', 'diff3.out') - or die "Failed to write output: $!"; - print $dfh $udiff; -} - -$results = do { local (@ARGV, $/) = 'data/marinerx1.udif'; <> }; - -#13 -is($udiff, $results, 'Diff matches expected results (udiff)'); - -$dt1 = $el1->delta($el2, window => 3); -$udiff = $dt1->udiff; - -$results = do { local (@ARGV, $/) = 'data/marinerx.udif'; <> }; - -#14 -is($udiff, $results, 'Diff matches expected results (udiff, 3 window)'); - -$dt1c = $el1c->delta($el2c, window => 3); -$udiff = $dt1c->udiff; - -#15 -is($udiff, $results, 'Chomped diff matches expected results (udiff, 3 window)'); - -if ($save_output) { - open (my $dfh, '>', 'diff4.out') - or die "Failed to write output: $!"; - print $dfh $udiff; -} - -#Test with no newline at end of file -my $el4 = VCS::Lite->new('data/snarka.txt'); -my $el5 = VCS::Lite->new('data/snarkb.txt'); -my $dt2 = $el4->delta($el5); - -$results = do { local (@ARGV, $/) = 'data/snarkab.dif'; <> }; -$diff = $dt2->diff; - -#16 -is($diff, $results, 'Diff matches expected results (diff)'); - -$results = do { local (@ARGV, $/) = 'data/snarkab.udif'; <> }; -$udiff = $dt2->udiff; - -#17 -is($udiff, $results, 'Diff matches expected results (udiff)'); - -if ($save_output) { - open (my $dfh, '>', 'diff5.out') - or die "Failed to write output: $!"; - print $dfh $udiff; -} diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/merge1.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/merge1.t --- libvcs-lite-perl-0.08/t/merge1.t 2005-04-03 12:06:00.000000000 +0100 +++ libvcs-lite-perl-0.09/t/merge1.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,43 +0,0 @@ - -use strict; -use Test::More tests => 4; -use VCS::Lite; - -my $el1 = VCS::Lite->new('data/mariner.txt'); - -#01 -isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); - -my $el2 = VCS::Lite->new('data/marinerx.txt'); -my $el3 = VCS::Lite->new('data/marinery.txt'); - -my $el4 = $el1->merge($el2,$el3); - -#02 -isa_ok($el4,'VCS::Lite','Return from merge method'); - -my $merged = $el4->text; - -#Uncomment for debugging -#open MERGE,'>merge1.out'; -#print MERGE $merged; -#close MERGE; - -my $results = do { local (@ARGV, $/) = 'data/marinerxy.txt'; <> }; # slurp entire file - -#03 -is($merged, $results, 'Merge matches expected results'); - -$el3 = VCS::Lite->new('data/marinerz.txt'); - -$el4 = $el1->merge($el2,$el3); -$merged = $el4->text; - -#04 -isa_ok($el4,'VCS::Lite','merge returns'); - -#Uncomment for debugging -#open MERGE,'>merge2.out'; -#print MERGE $merged; -#close MERGE; - diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/merge.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/merge.t --- libvcs-lite-perl-0.08/t/merge.t 2005-04-03 13:24:09.000000000 +0100 +++ libvcs-lite-perl-0.09/t/merge.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,42 +0,0 @@ - -use strict; -use Test::More tests => 5; -use VCS::Lite; - -my $el1 = VCS::Lite->new('data/mariner.txt'); - -#01 -isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); - -my $el2 = VCS::Lite->new('data/marinerx.txt'); -my $el3 = VCS::Lite->new('data/marinery.txt'); - -$el1->apply($el2); - -#02 -ok(!$el1->delta($el2), "Not different once applied"); - -my $el1a = $el1->original; - -#03 -ok($el1->delta($el1a), "but different from original"); - -#04 -isa_ok($el1a,'VCS::Lite','Return from original'); - -$el1a->apply($el3); -$el1->apply($el1a, base => 'original'); - -my $merged = $el1->text; - -#Uncomment for debugging -open MERGE,'>merge1.out'; -print MERGE $merged; -close MERGE; - -my $results = do { local (@ARGV, $/) = 'data/marinerxy.txt'; <> }; # slurp entire file - -#05 -is($merged, $results, 'Merge matches expected results'); - - diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/patch.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/patch.t --- libvcs-lite-perl-0.08/t/patch.t 2006-02-22 22:53:46.000000000 +0000 +++ libvcs-lite-perl-0.09/t/patch.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,150 +0,0 @@ - -use strict; -use Test::More tests => 19; -use VCS::Lite; - -my $save_output = $ENV{VCS_LITE_KEEP_OUTPUT}; - -my $el1 = VCS::Lite->new('data/mariner.txt'); - -#01 -isa_ok($el1,'VCS::Lite','Return from new, passed filespec'); - -my $el2 = VCS::Lite->new('data/marinerx.txt'); -my $dt1 = VCS::Lite::Delta->new('data/marinerx.dif',undef,'mariner.txt','marinerx.txt'); - -#02 -isa_ok($dt1,'VCS::Lite::Delta','New delta'); - -my $el3 = $el1->patch($dt1); - -#03 -isa_ok($el3,'VCS::Lite','Return from patch method'); - -my $out2 = $el2->text; -my $out3 = $el3->text; - -if ($save_output) { - open (my $dfh, '>', 'patch1.out') - or die "Failed to write output: $!"; - print $dfh $out3; -} - -#04 -is($out2, $out3, 'Patched file is the same as marinerx'); - -my $dt2 = VCS::Lite::Delta->new('data/marinerx.udif',undef,'mariner.txt','marinerx.txt'); - -#05 -isa_ok($dt2,'VCS::Lite::Delta','New delta'); - -my $el4 = $el1->patch($dt2); - -#06 -isa_ok($el4,'VCS::Lite','Patch applied'); - -my $out4 = $el4->text; - -#07 -is($out2, $out4, 'Patched file is the same as marinerx'); - -my $el1c = VCS::Lite->new('data/mariner.txt', {chomp => 1}); -my $el2c = VCS::Lite->new('data/marinerx.txt', {chomp => 1}); -my $dt1c = VCS::Lite::Delta->new('data/marinerx.dif',{chomp => 1}, - 'mariner.txt','marinerx.txt'); - -#08 -isa_ok($dt1c,'VCS::Lite::Delta','New delta (chomped)'); - -my $el3c = $el1c->patch($dt1c); - -#09 -isa_ok($el3c,'VCS::Lite','Return from patch method (chomped)'); - -$out2 = $el2c->text; -$out3 = $el3c->text; - -if ($save_output) { - open (my $dfh, '>', 'patch1c.out') - or die "Failed to write output: $!"; - print $dfh $out3; -} - -#10 -is($out2, $out3, 'Patched file is the same as marinerx'); - -my $dt2c = VCS::Lite::Delta->new('data/marinerx.udif',{chomp => 1}, - 'mariner.txt','marinerx.txt'); - -#11 -isa_ok($dt2c,'VCS::Lite::Delta','New delta'); - -my $el4c = $el1c->patch($dt2c); - -#12 -isa_ok($el4c,'VCS::Lite','Patch applied'); - -$out4 = $el4c->text; - -#13 -is($out2, $out4, 'Patched file is the same as marinerx (chomped)'); - -my $udiff = $dt2->udiff; - -#14 -ok($udiff, "udiff returns text"); - -if ($save_output) { - open (my $dfh, '>', 'patch2.out') - or die "Failed to write output: $!"; - print $dfh $udiff; -} - -my $results = do { local (@ARGV, $/) = 'data/marinerx.udif'; <> }; # slurp entire file - -$results =~ s/^\+\+\+.*\n//s; -$results =~ s/^---.*\n//s; -$udiff =~ s/^\+\+\+.*\n//s; -$udiff =~ s/^---.*\n//s; - -#15 -is($udiff,$results,'udiff output matches original udiff'); - -$udiff = $dt2c->udiff; - -#16 -ok($udiff, "udiff returns text (chomped)"); - -if ($save_output) { - open (my $dfh, '>', 'patch2c.out') - or die "Failed to write output: $!"; - print $dfh $udiff; -} - -$udiff =~ s/^\+\+\+.*\n//s; -$udiff =~ s/^---.*\n//s; - -#17 -is($udiff,$results,'udiff output matches original udiff'); - - -my $el5 = VCS::Lite->new('data/snarka.txt'); -my $el6 = VCS::Lite->new('data/snarkb.txt'); -my $dt3 = VCS::Lite::Delta->new('data/snarkab.dif',undef,'snarka.txt','snarkb.txt'); -my $el7 = $el5->patch($dt3); - -my $out6 = $el6->text; -my $out7 = $el7->text; - -#16 -is($out6, $out7, 'Patched file is the same as snarkb (diff)'); - -my $dt4 = VCS::Lite::Delta->new('data/snarkab.udif',undef,'snarka.txt','snarkb.txt'); -my $el8 = $el5->patch($dt4); - -$out7 = $el7->text; -my $out8 = $el8->text; - -#17 -is($out6, $out8, 'Patched file is the same as snarkb (udiff)'); - diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/pod_coverage.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/pod_coverage.t --- libvcs-lite-perl-0.08/t/pod_coverage.t 2005-10-05 23:16:20.000000000 +0100 +++ libvcs-lite-perl-0.09/t/pod_coverage.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -# -*- perl -*- - -# t/pod_coverage.t - Generic Test::Pod::Coverage testing module - -use Test::More; -eval "use Test::Pod::Coverage 1.00"; -plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; -all_pod_coverage_ok(); - diff -Nru /tmp/3FFvt5GgNr/libvcs-lite-perl-0.08/t/pod.t /tmp/iiU5QEWNKc/libvcs-lite-perl-0.09/t/pod.t --- libvcs-lite-perl-0.08/t/pod.t 2005-10-05 23:16:20.000000000 +0100 +++ libvcs-lite-perl-0.09/t/pod.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -# -*- perl -*- - -# t/pod.t - Generic Test::Pod testing module - -use Test::More; -eval "use Test::Pod 1.00"; -plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; -all_pod_files_ok(); -