r72699 - in /branches/upstream/libtext-diff-perl/current: Changes MANIFEST META.yml Makefile.PL lib/Text/Diff.pm lib/Text/Diff/Config.pm lib/Text/Diff/Table.pm
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Sun Apr 17 19:09:49 UTC 2011
Author: periapt-guest
Date: Sun Apr 17 19:09:24 2011
New Revision: 72699
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72699
Log:
[svn-upgrade] new version libtext-diff-perl (1.41)
Added:
branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Config.pm
Modified:
branches/upstream/libtext-diff-perl/current/Changes
branches/upstream/libtext-diff-perl/current/MANIFEST
branches/upstream/libtext-diff-perl/current/META.yml
branches/upstream/libtext-diff-perl/current/Makefile.PL
branches/upstream/libtext-diff-perl/current/lib/Text/Diff.pm
branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Table.pm
Modified: branches/upstream/libtext-diff-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/Changes?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/Changes (original)
+++ branches/upstream/libtext-diff-perl/current/Changes Sun Apr 17 19:09:24 2011
@@ -1,4 +1,11 @@
Changes for Perl extension Text-Diff
+
+1.41 Sun 17 Apr 2011
+ - Add Text::Dif::Config to MANIFEST.
+
+1.40 Sat 16 Apr 2011
+ - Added DIFF_OUTPUT_UNICODE env variable to allow outputting unicode
+ characters. Thanks to Shlomi Fish for the patch.
1.37 Thu 16 Jul 2009
- Switching to a production release
Modified: branches/upstream/libtext-diff-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/MANIFEST?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/MANIFEST (original)
+++ branches/upstream/libtext-diff-perl/current/MANIFEST Sun Apr 17 19:09:24 2011
@@ -1,5 +1,6 @@
Changes
lib/Text/Diff.pm
+lib/Text/Diff/Config.pm
lib/Text/Diff/Table.pm
LICENSE
Makefile.PL
Modified: branches/upstream/libtext-diff-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/META.yml?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/META.yml (original)
+++ branches/upstream/libtext-diff-perl/current/META.yml Sun Apr 17 19:09:24 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-Diff
-version: 1.37
+version: 1.41
abstract: Perform diffs on files and record sets
author:
- Adam Kennedy <adamk at cpan.org>
@@ -10,15 +10,16 @@
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
- Test: 0
requires:
Algorithm::Diff: 1.19
Exporter: 0
+resources:
+ repository: https://github.com/Ovid/Text-Diff
no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.50
+generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: branches/upstream/libtext-diff-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/Makefile.PL?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/Makefile.PL (original)
+++ branches/upstream/libtext-diff-perl/current/Makefile.PL Sun Apr 17 19:09:24 2011
@@ -1,26 +1,27 @@
use strict;
+
BEGIN {
- require 5.005_03;
+ require 5.005_03;
}
use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'Text::Diff',
- ABSTRACT => 'Perform diffs on files and record sets',
- VERSION_FROM => 'lib/Text/Diff.pm',
- PREREQ_PM => {
- 'Exporter' => 0,
- 'Algorithm::Diff' => '1.19',
- },
- ($] >= 5.005 ? (
- AUTHOR => 'Adam Kennedy <adamk at cpan.org>',
- ) : ()),
- ($ExtUtils::MakeMaker::VERSION ge '6.30_00' ? (
- LICENSE => 'perl',
- ) : ()),
- ($ExtUtils::MakeMaker::VERSION ge '6.46' ? (
- META_MERGE => {
- build_requires => { Test => 0 }
- }
- ) : ()),
+ NAME => 'Text::Diff',
+ ABSTRACT => 'Perform diffs on files and record sets',
+ VERSION_FROM => 'lib/Text/Diff.pm',
+ PREREQ_PM => {
+ 'Exporter' => 0,
+ 'Algorithm::Diff' => '1.19',
+ },
+ ( $] >= 5.005 ? ( AUTHOR => 'Adam Kennedy <adamk at cpan.org>', ) : () ),
+ (
+ $ExtUtils::MakeMaker::VERSION ge '6.30_00' ? ( LICENSE => 'perl', ) : ()
+ ),
+ (
+ $ExtUtils::MakeMaker::VERSION ge '6.46'
+ ? ( META_MERGE => { build_requires => { Test => 0 } } )
+ : ()
+ ),
+ META_MERGE =>
+ { resources => { repository => 'https://github.com/Ovid/Text-Diff' } },
);
Modified: branches/upstream/libtext-diff-perl/current/lib/Text/Diff.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/lib/Text/Diff.pm?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/lib/Text/Diff.pm (original)
+++ branches/upstream/libtext-diff-perl/current/lib/Text/Diff.pm Sun Apr 17 19:09:24 2011
@@ -7,7 +7,7 @@
use Algorithm::Diff ();
use vars qw{$VERSION @ISA @EXPORT};
BEGIN {
- $VERSION = '1.37';
+ $VERSION = '1.41';
@ISA = 'Exporter';
@EXPORT = 'diff';
};
Added: branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Config.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Config.pm?rev=72699&op=file
==============================================================================
--- branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Config.pm (added)
+++ branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Config.pm Sun Apr 17 19:09:24 2011
@@ -1,0 +1,143 @@
+package Text::Diff::Config;
+
+use strict;
+use warnings;
+
+use vars '$VERSION';
+$VERSION = '1.41';
+
+use vars qw($Output_Unicode);
+
+BEGIN
+{
+ $Output_Unicode = $ENV{'DIFF_OUTPUT_UNICODE'};
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Text::Diff::Config - global configuration for Text::Diff (as a
+separate module).
+
+=head1 SYNOPSIS
+
+ use Text::Diff::Config;
+
+ $Text::Diff::Config::Output_Unicode = 1;
+
+=head1 DESCRIPTION
+
+This module configures Text::Diff and its related modules. Currently it contains
+only one global variable $Text::Diff::Config::Output_Unicode which is a boolean
+flag, that if set outputs unicode characters as themselves without escaping them
+as C< \x{HHHH} > first.
+
+It is initialized to the value of C< $ENV{DIFF_OUTPUT_UNICODE} >, but can be
+set to a different value at run-time, including using local.
+
+=head1 AUTHOR
+
+Shlomi Fish, L<http://www.shlomifish.org/> .
+
+=head1 LICENSE
+
+Copyright 2010, Shlomi Fish.
+
+This file is licensed under the MIT/X11 License:
+L<http://www.opensource.org/licenses/mit-license.php>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+=cut
+
+package Text::Diff::Config;
+
+use strict;
+use warnings;
+
+use vars qw($Output_Unicode);
+
+BEGIN
+{
+ $Output_Unicode = $ENV{'DIFF_OUTPUT_UNICODE'};
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Text::Diff::Config - global configuration for Text::Diff (as a
+separate module).
+
+=head1 SYNOPSIS
+
+ use Text::Diff::Config;
+
+ $Text::Diff::Config::Output_Unicode = 1;
+
+=head1 DESCRIPTION
+
+This module configures Text::Diff and its related modules. Currently it contains
+only one global variable $Text::Diff::Config::Output_Unicode which is a boolean
+flag, that if set outputs unicode characters as themselves without escaping them
+as C< \x{HHHH} > first.
+
+It is initialized to the value of C< $ENV{DIFF_OUTPUT_UNICODE} >, but can be
+set to a different value at run-time, including using local.
+
+=head1 AUTHOR
+
+Shlomi Fish, L<http://www.shlomifish.org/> .
+
+=head1 LICENSE
+
+Copyright 2010, Shlomi Fish.
+
+This file is licensed under the MIT/X11 License:
+L<http://www.opensource.org/licenses/mit-license.php>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+=cut
+
Modified: branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Table.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Table.pm?rev=72699&op=diff
==============================================================================
--- branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Table.pm (original)
+++ branches/upstream/libtext-diff-perl/current/lib/Text/Diff/Table.pm Sun Apr 17 19:09:24 2011
@@ -4,17 +4,19 @@
use strict;
use Carp;
use vars qw{$VERSION @ISA @EXPORT_OK};
+use Text::Diff::Config;
+
BEGIN {
- $VERSION = '1.37';
- @ISA = qw( Text::Diff::Base Exporter );
- @EXPORT_OK = qw( expand_tabs );
+ $VERSION = '1.41';
+ @ISA = qw( Text::Diff::Base Exporter );
+ @EXPORT_OK = qw( expand_tabs );
}
my %escapes = map {
my $c =
$_ eq '"' || $_ eq '$' ? qq{'$_'}
- : $_ eq "\\" ? qq{"\\\\"}
- : qq{"$_"};
+ : $_ eq "\\" ? qq{"\\\\"}
+ : qq{"$_"};
( ord eval $c => $_ )
} (
map( chr, 32..126),
@@ -35,11 +37,11 @@
my $spaces = " " x ( 8 - $count % 8 + 8 * length $2 );
$count = 0;
$spaces;
- }
- else {
- $count += length $3;
- $3;
- }
+ }
+ else {
+ $count += length $3;
+ $3;
+ }
}ge;
return $s;
@@ -57,13 +59,16 @@
## use utf8 if available. don't if not.
my $escaper = <<'EOCODE';
sub escape($) {
- use utf8;
- join "", map {
- $_ = ord;
- exists $escapes{$_}
- ? $escapes{$_}
- : sprintf( "\\x{%04x}", $_ );
- } split //, shift;
+ use utf8;
+ join "", map {
+ my $c = $_;
+ $_ = ord;
+ exists $escapes{$_}
+ ? $escapes{$_}
+ : $Text::Diff::Config::Output_Unicode
+ ? $c
+ : sprintf( "\\x{%04x}", $_ );
+ } split //, shift;
}
1;
@@ -115,23 +120,23 @@
$A->[1] eq $B->[1] ? "="
: "*";
if ( $elt_type ne "*" ) {
- if ( $elt_type eq "=" || $A->[1] =~ /\S/ || $B->[1] =~ /\S/ ) {
- $A->[1] = escape trim_trailing_line_ends expand_tabs $A->[1];
- $B->[1] = escape trim_trailing_line_ends expand_tabs $B->[1];
- }
- else {
- $A->[1] = escape $A->[1];
- $B->[1] = escape $B->[1];
- }
+ if ( $elt_type eq "=" || $A->[1] =~ /\S/ || $B->[1] =~ /\S/ ) {
+ $A->[1] = escape trim_trailing_line_ends expand_tabs $A->[1];
+ $B->[1] = escape trim_trailing_line_ends expand_tabs $B->[1];
+ }
+ else {
+ $A->[1] = escape $A->[1];
+ $B->[1] = escape $B->[1];
+ }
}
else {
## not using \z here for backcompat reasons.
$A->[1] =~ /^(\s*?)([^ \t].*?)?(\s*)(?![\n\r])$/s;
my ( $l_ws_A, $body_A, $t_ws_A ) = ( $1, $2, $3 );
- $body_A = "" unless defined $body_A;
+ $body_A = "" unless defined $body_A;
$B->[1] =~ /^(\s*?)([^ \t].*?)?(\s*)(?![\n\r])$/s;
my ( $l_ws_B, $body_B, $t_ws_B ) = ( $1, $2, $3 );
- $body_B = "" unless defined $body_B;
+ $body_B = "" unless defined $body_B;
my $added_escapes;
@@ -378,6 +383,13 @@
Whether or not line 3 should have that tab character escaped is a judgement
call; so far I'm choosing not to.
+=head1 UNICODE
+
+To output the raw unicode chracters consult the documentation of
+L<Text::Diff::Config>. You can set the C<DIFF_OUTPUT_UNICODE> environment
+variable to 1 to output it from the command line. For more information,
+consult this bug: L<https://rt.cpan.org/Ticket/Display.html?id=54214> .
+
=head1 LIMITATIONS
Table formatting requires buffering the entire diff in memory in order to
More information about the Pkg-perl-cvs-commits
mailing list