Skip Menu |
 

This queue is for tickets about the SVN-Simple CPAN distribution.

Report information
The Basics
Id: 51087
Status: open
Priority: 0/
Queue: SVN-Simple

People
Owner: Nobody in particular
Requestors: salvatore.bonaccorso [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.27
Fixed in: (no value)



Subject: Fails to build with new subversion 1.6.x
Download (untitled) / with headers
text/plain 1.4k
Hi SVN-Simple does not build anymore with subversion 1.6.x. When building the tests fail. See: http://bugs.debian.org/543098 ---(snip)------------------------------------------------------------- Show quoted text
> make[1]: Entering directory
`/build/user-libsvn-simple-perl_0.27-2.1-amd64-lF4PsB/libsvn-simple-perl-0.27' Show quoted text
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t Show quoted text
> # build missing directory for trunk/deep/more > # build missing directory for trunk/deep > # build missing directory for trunk > # build missing directory for trunk/deep2/more > # build missing directory for trunk/deep2 > # committed 1,2009-08-22T14:19:03.523971Z,root > # committed 2,2009-08-22T14:19:04.146869Z,root > # committed 3,2009-08-22T14:19:05.361201Z,root > Transaction is out of date: '/trunk/deep/more' is out of date at
t/1edit.t line 102 Show quoted text
> # Looks like your test died just after 8. > t/1edit....dubious > Test returned status 255 (wstat 65280, 0xff00) > after all the subtests completed successfully > Failed Test Stat Wstat Total Fail List of Failed >
------------------------------------------------------------------------------- Show quoted text
> t/1edit.t 255 65280 8 0 ?? > Failed 1/1 test scripts. 0/8 subtests failed. > Files=1, Tests=8, 4 wallclock secs ( 0.09 cusr + 0.02 csys = 0.11 CPU) > Failed 1/1 test programs. 0/8 subtests failed. > make[1]: *** [test_dynamic] Error 255
---(snap)------------------------------------------------------------- Bests Salvatore
From: whynot [...] pozharski.name
Download (untitled) / with headers
text/plain 1.7k
No, that all is plain wrong. A problem is not in subversion (whatever version) but in Perl. B<SVN::Simple> happily builds with 5.10.0 (I've checked) and fails with 5.10.1 (to be honest, I've built 0.27; to be honest -- 0.28 is a joke, it fixes nothing). More details: Applaying F<show.diff> on otherwise unaltered source and running C<perl -I . bug-sample.pl> clearly shows what a problem is: repository is: repo.brExXzJ vvv Show quoted text
>>> revision: 1 >>> date: 2010-01-01T02:10:41.563339Z
^^^ Show quoted text
>>>>> I<$self->{BASE}>: 2 >>>>> I<$base_revision>: 2
vvv Show quoted text
>>> revision: 2 >>> date: 2010-01-01T02:10:41.586608Z
^^^ Show quoted text
>>>>> I<$self->{BASE}>: 3 >>>>> I<$base_revision>: 2
vvv Show quoted text
>>> revision: 3 >>> date: 2010-01-01T02:10:41.621256Z
^^^ Show quoted text
>>>>> I<$self->{BASE}>: 4 >>>>> I<$base_revision>: 2
Transaction is out of date: File '/abc' is out of date at ../bug-sample.pl line 55 You see? I<$base_revision> is always C<2>! (and I've checked -- adding some heartbeat to B<_rev_from_root()> shows that this method isn't entered.) That's PFM how that happens (absolutely unbackgrounded guess): something leaks from inside of Subversion XS (or even more interesting "my-if" is starting to decoy). Anyway -- putting I<$base_revision>'s declaration in a separate statement and then either C<if( $self->{BASE} ) { }> or C<$self->{BASE} and ...> or F<minimal.diff> fixes this. F<more.diff> touches B<open_directory()> too. However, something wrong is still inside -- looking at F<1edit.t> I conclude that the last edit (at lines 100..102) is revision #3, while opened is revision #2. I didn't triggered that, thus I hadn't investigated any further. p.s. That comment is worth extra bugreport, isnt't it? I don't think so -- that's all the same.
Subject: show.diff
Download show.diff
text/x-diff 614b
--- libsvn-simple-perl-0.27.orig/lib/SVN/Simple/Edit.pm 2009-12-04 14:15:43.000000000 +0200 +++ libsvn-simple-perl-0.27/lib/SVN/Simple/Edit.pm 2009-12-04 14:16:41.000000000 +0200 @@ -246,6 +246,10 @@ $pbaton ||= $self->find_pbaton ($path); my $base_revision = $self->_rev_from_root ($path) if $self->{root}; $base_revision ||= $self->{BASE}; + print <<END_OF_MESSAGE; +>>>>> I<\$self->{BASE}>: $self->{BASE} +>>>>> I<\$base_revision>: $base_revision +END_OF_MESSAGE $self->{FILES}{$path} = 1; $self->{BATON}{$path} = $self->SUPER::open_file ($path, $pbaton, $base_revision,
Subject: minimal.diff
Download minimal.diff
text/x-diff 2.7k
diff -Nur libsvn-simple-perl-0.27.orig/lib/SVN/Simple/Edit.pm libsvn-simple-perl-0.27/lib/SVN/Simple/Edit.pm --- libsvn-simple-perl-0.27.orig/lib/SVN/Simple/Edit.pm 2005-03-06 12:46:54.000000000 +0200 +++ libsvn-simple-perl-0.27/lib/SVN/Simple/Edit.pm 2009-12-04 12:18:01.000000000 +0200 @@ -244,8 +244,8 @@ $path =~ s|^/||; $self->close_other_baton ($path); $pbaton ||= $self->find_pbaton ($path); - my $base_revision = $self->_rev_from_root ($path) if $self->{root}; - $base_revision ||= $self->{BASE}; + my $base_revision = $self->{root} ? $self->_rev_from_root ($path) + : $self->{BASE}; $self->{FILES}{$path} = 1; $self->{BATON}{$path} = $self->SUPER::open_file ($path, $pbaton, $base_revision, diff -Nur libsvn-simple-perl-0.27.orig/t/2cycle.t libsvn-simple-perl-0.27/t/2cycle.t --- libsvn-simple-perl-0.27.orig/t/2cycle.t 1970-01-01 03:00:00.000000000 +0300 +++ libsvn-simple-perl-0.27/t/2cycle.t 2009-12-04 12:15:22.000000000 +0200 @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +use strict; +use Test::More tests => 10; +use File::Path; +use File::Spec; + +BEGIN { +require_ok 'SVN::Core'; +require_ok 'SVN::Repos'; +require_ok 'SVN::Fs'; +require_ok 'SVN::Simple::Edit'; +} + +local $/; + +my $repospath = "t/repos"; +rmtree ([$repospath]) if -d $repospath; + +$ENV{SVNFSTYPE} ||= (($SVN::Core::VERSION =~ /^1\.0/) ? 'bdb' : 'fsfs'); + +my $repos = SVN::Repos::create($repospath, undef, undef, undef, + {'fs-type' => $ENV{SVNFSTYPE}}) + or die "failed to create repository at $repospath"; + +my $uri = File::Spec->rel2abs( $repospath ) ; +$uri =~ s{^|\\}{/}g if ($^O eq 'MSWin32'); +$uri = "file://$uri"; + +ok($repos); + +my $fs = $repos->fs; + +sub committed { + diag "committed ".join(',',@_); +} + +my $edit; + +sub new_edit { + my ($check) = @_; + my $base = $fs->youngest_rev; + $edit = SVN::Simple::Edit-> + new(_editor => [SVN::Repos::get_commit_editor + ($repos, $uri, + '/', 'root', 'FOO', \&committed)], + pool => SVN::Pool->new, + missing_handler => ($check ? + (&SVN::Simple::Edit::check_missing ($fs->revision_root ($base))) : + sub { + my ($edit, $path) = @_; + diag "build missing directory for $path"; + $edit->add_directory ($path); + })); + $edit->open_root ($base); + return $edit; +} + +my $filename = 'filea'; + +$edit = new_edit; +$edit->add_file ($filename); +$edit->modify_file ('filea', "rev: 1\n"); +$edit->close_edit(); + +cmp_ok($fs->youngest_rev, '==', 1); + +for my $rev ( 2 .. 5 ) { + $edit = new_edit; + my $content = SVN::Fs::file_contents($fs->revision_root ($rev - 1), $filename ); + is(<$content>, sprintf ("rev: %i\n", $rev - 1), "previuos revision verified"); + $edit->modify_file ($filename, "rev: $rev\n"); + $edit->close_edit; +}
Subject: more.diff
Download more.diff
text/x-diff 3.2k
diff -Nur libsvn-simple-perl-0.27.orig/lib/SVN/Simple/Edit.pm libsvn-simple-perl-0.27/lib/SVN/Simple/Edit.pm --- libsvn-simple-perl-0.27.orig/lib/SVN/Simple/Edit.pm 2005-03-06 12:46:54.000000000 +0200 +++ libsvn-simple-perl-0.27/lib/SVN/Simple/Edit.pm 2009-12-04 13:46:36.000000000 +0200 @@ -214,8 +214,8 @@ $path =~ s|^/||; $self->close_other_baton ($path); $pbaton ||= $self->find_pbaton ($path); - my $base_revision = $self->_rev_from_root ($path) if $self->{root}; - $base_revision ||= $self->{BASE}; + my $base_revision = $self->{root} ? $self->_rev_from_root ($path) + : $self->{BASE}; $self->{BATON}{$path} = $self->SUPER::open_directory ($path, $pbaton, $base_revision, $self->{pool}); @@ -244,8 +244,8 @@ $path =~ s|^/||; $self->close_other_baton ($path); $pbaton ||= $self->find_pbaton ($path); - my $base_revision = $self->_rev_from_root ($path) if $self->{root}; - $base_revision ||= $self->{BASE}; + my $base_revision = $self->{root} ? $self->_rev_from_root ($path) + : $self->{BASE}; $self->{FILES}{$path} = 1; $self->{BATON}{$path} = $self->SUPER::open_file ($path, $pbaton, $base_revision, diff -Nur libsvn-simple-perl-0.27.orig/t/2cycle.t libsvn-simple-perl-0.27/t/2cycle.t --- libsvn-simple-perl-0.27.orig/t/2cycle.t 1970-01-01 03:00:00.000000000 +0300 +++ libsvn-simple-perl-0.27/t/2cycle.t 2009-12-04 12:15:22.000000000 +0200 @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +use strict; +use Test::More tests => 10; +use File::Path; +use File::Spec; + +BEGIN { +require_ok 'SVN::Core'; +require_ok 'SVN::Repos'; +require_ok 'SVN::Fs'; +require_ok 'SVN::Simple::Edit'; +} + +local $/; + +my $repospath = "t/repos"; +rmtree ([$repospath]) if -d $repospath; + +$ENV{SVNFSTYPE} ||= (($SVN::Core::VERSION =~ /^1\.0/) ? 'bdb' : 'fsfs'); + +my $repos = SVN::Repos::create($repospath, undef, undef, undef, + {'fs-type' => $ENV{SVNFSTYPE}}) + or die "failed to create repository at $repospath"; + +my $uri = File::Spec->rel2abs( $repospath ) ; +$uri =~ s{^|\\}{/}g if ($^O eq 'MSWin32'); +$uri = "file://$uri"; + +ok($repos); + +my $fs = $repos->fs; + +sub committed { + diag "committed ".join(',',@_); +} + +my $edit; + +sub new_edit { + my ($check) = @_; + my $base = $fs->youngest_rev; + $edit = SVN::Simple::Edit-> + new(_editor => [SVN::Repos::get_commit_editor + ($repos, $uri, + '/', 'root', 'FOO', \&committed)], + pool => SVN::Pool->new, + missing_handler => ($check ? + (&SVN::Simple::Edit::check_missing ($fs->revision_root ($base))) : + sub { + my ($edit, $path) = @_; + diag "build missing directory for $path"; + $edit->add_directory ($path); + })); + $edit->open_root ($base); + return $edit; +} + +my $filename = 'filea'; + +$edit = new_edit; +$edit->add_file ($filename); +$edit->modify_file ('filea', "rev: 1\n"); +$edit->close_edit(); + +cmp_ok($fs->youngest_rev, '==', 1); + +for my $rev ( 2 .. 5 ) { + $edit = new_edit; + my $content = SVN::Fs::file_contents($fs->revision_root ($rev - 1), $filename ); + is(<$content>, sprintf ("rev: %i\n", $rev - 1), "previuos revision verified"); + $edit->modify_file ($filename, "rev: $rev\n"); + $edit->close_edit; +}
Subject: bug-sample.pl
Download bug-sample.pl
text/x-perl 1.3k
#!/usr/bin/perl # $Id$ package main; use strict; use warnings; use version 0.50; our $VERSION = qv q|0.0.0|; use SVN::Ra; use SVN::Simple::Edit; use File::Temp qw| tempdir |; use Cwd; my $repo = tempdir q|repo.XXXXXXX|; system qw| svnadmin create |, $repo and die qq|can't create repository: $?|; print qq|repository is: $repo\n|; my $ra = SVN::Ra->new( sprintf q|file://%s/%s|, getcwd, $repo ) or die qq|plug: SVN::Ra handles exceptions itself|; my $filename = 'abc'; for my $rev ( 0 .. 5 ) { my $editor = SVN::Simple::Edit->new( _editor => [ $ra->get_commit_editor( qq|\$rev $rev|, sub { printf <<END_OF_MESSAGE, @_[0,1]; }, vvv >>> revision: %i >>> date: %s ^^^ END_OF_MESSAGE '', '', '' ) ], missing_handler => \&SVN::Simple::Edit::open_missing, ); $editor->open_root( $ra->get_latest_revnum + 1 ); my $file; if( $rev ) { open my $fh, q|+>|, \$file or die qq|can't (open) in-memory file: $!|; $ra->get_file( $filename, $rev, $fh ); close $fh or die qq|can't (close) in-memory file: $!|; } else { $editor->add_file( $filename ); $file = ''; }; $file .= sprintf qq|\$rev: %i\n|, $rev + 1; $editor->modify_file( $filename, $file ); $editor->close_edit; }; 1; # vim: set filetype=perl
From: whynot [...] pozharski.name
Download (untitled) / with headers
text/plain 725b
On Sat Jan 02 10:35:58 2010, whynot wrote: Show quoted text
> No, that all is plain wrong. A problem is not in subversion (whatever > version) but in Perl. B<SVN::Simple> happily builds with 5.10.0
*SKIP* Show quoted text
> p.s. That comment is worth extra bugreport, isnt't it? I don't think > so -- that's all the same.
Pity on me. I was blinded with my own B<SVN::Simple> problems and was hipocritical. I must be punished. Please unread my previous comments -- I've investigated the issue further and I think now differently. That seems that subversion-1.6 doesn't allow anymore removing already removed entries. And svn-simple-0.28 is fake anyway. Consider F<deep.diff>, please. p.s. I hope I still have right for yet other bugreport.
Subject: deep.diff
Download deep.diff
text/x-diff 494b
diff -ur libsvn-simple-perl-0.27.orig/t/1edit.t libsvn-simple-perl-0.27/t/1edit.t --- libsvn-simple-perl-0.27.orig/t/1edit.t 2004-11-13 12:14:50.000000000 +0200 +++ libsvn-simple-perl-0.27/t/1edit.t 2010-01-07 11:05:32.000000000 +0200 @@ -98,7 +98,7 @@ $edit = new_edit; $edit->open_directory ('trunk'); -$edit->open_directory ('trunk/deep'); -$edit->delete_entry ('trunk/deep/more'); +$edit->open_directory ('trunk/deep2'); +$edit->delete_entry ('trunk/deep2/more'); $edit->close_edit;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.