[svk-commit] r2180 - in trunk: lib/SVK lib/SVK/Mirror/Backend t t/mirror

clkao at bestpractical.com clkao at bestpractical.com
Sat Nov 18 23:43:25 EST 2006


Author: clkao
Date: Sat Nov 18 23:43:24 2006
New Revision: 2180

Modified:
   trunk/Makefile.PL
   trunk/lib/SVK/Command.pm
   trunk/lib/SVK/Mirror/Backend/SVNRa.pm
   trunk/lib/SVK/Path.pm
   trunk/lib/SVK/Test.pm
   trunk/lib/SVK/XD.pm
   trunk/t/05svm-lock.t
   trunk/t/50dav.t
   trunk/t/72sign.t
   trunk/t/mirror/dav-authz.t

Log:
Remove the code supporting svn < 1.3.0.


Modified: trunk/Makefile.PL
==============================================================================
--- trunk/Makefile.PL	(original)
+++ trunk/Makefile.PL	Sat Nov 18 23:43:24 2006
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-my $required_svn = '1.2.0';
+my $required_svn = '1.3.0';
 my $required_svm = '0.71';
 
 use strict;

Modified: trunk/lib/SVK/Command.pm
==============================================================================
--- trunk/lib/SVK/Command.pm	(original)
+++ trunk/lib/SVK/Command.pm	Sat Nov 18 23:43:24 2006
@@ -116,13 +116,7 @@
     $ofh = select STDERR unless $output;
     print $ret if $ret && $ret !~ /^\d+$/;
     unless (ref($@)) {
-	if ($SVN::Core::VERSION gt '1.2.2') {
-	    print $@ if $@;
-	}
-	else {
-	    # if an error handler terminates editor call, there will be stack trace
-	    print $@ if $@ && $@ !~ m/\n.+\n.+\n/
-	}
+	print $@ if $@;
     }
     $ret = 1 if ($ret ? $ret !~ /^\d+$/ : $@);
 

Modified: trunk/lib/SVK/Mirror/Backend/SVNRa.pm
==============================================================================
--- trunk/lib/SVK/Mirror/Backend/SVNRa.pm	(original)
+++ trunk/lib/SVK/Mirror/Backend/SVNRa.pm	Sat Nov 18 23:43:24 2006
@@ -492,7 +492,6 @@
     die loc("relayed merge back not supported yet.\n") if $self->_relayed;
     $self->{commit_ra} = $self->_new_ra( url => $self->mirror->url.$path );
 
-    my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
     # XXX: add error check for get_commit_editor here, auth error happens here
     return SVN::Delta::Editor->new(
         $self->{commit_ra}->get_commit_editor(
@@ -501,8 +500,7 @@
 		# only recycle the ra if we are committing from root
 		$self->_ra_finished($self->{commit_ra});
                 $committed->(@_);
-            },
-            @lock ) );
+            }, undef, 0 ) );
 }
 
 sub change_rev_prop {

Modified: trunk/lib/SVK/Path.pm
==============================================================================
--- trunk/lib/SVK/Path.pm	(original)
+++ trunk/lib/SVK/Path.pm	Sat Nov 18 23:43:24 2006
@@ -411,11 +411,7 @@
 
 =cut
 
-use SVN::Fs;
-*nearest_copy = SVN::Fs->can('closest_copy')
-  ? *_nearest_copy_svn : *_nearest_copy_svk;
-
-sub _nearest_copy_svn {
+sub nearest_copy {
     my ($root, $path, $ppool) = @_;
     if (ref($root) =~ m/^SVK::Path/) {
         ($root, $path) = ($root->root, $root->path);
@@ -438,61 +434,6 @@
     return ($toroot, $root->fs->revision_root($copyfrom_rev, $ppool), $path);
 }
 
-sub _nearest_copy_svk {
-    my ($root, $path, $ppool) = @_;
-    if (ref($root) =~ m/^SVK::Path/) {
-        ($root, $path) = ($root->root, $root->path);
-    }
-    my $fs = $root->fs;
-    my $spool = SVN::Pool->new_default;
-    my ($old_pool, $new_pool) = (SVN::Pool->new, SVN::Pool->new);
-
-    # XXX: this is duplicated as svk::util, maybe we should use
-    # traverse_history directly
-    if ($root->can('txn') && $root->txn) {
-	($root, $path) = $root->get_revision_root
-	    ($path, $root->txn->base_revision );
-    }
-    # normalize
-    my $hist = $root->node_history ($path)->prev(0);
-    my $rev = ($hist->location)[1];
-    $root = $fs->revision_root ($rev, $ppool);
-
-    while ($hist = $hist->prev(1, $new_pool)) {
-	# Find history_prev revision, if the path is different, bingo.
-	my ($hppath, $hprev) = $hist->location;
-	if ($hppath ne $path) {
-	    $hist = $root->node_history ($path, $new_pool)->prev(0);
-	    $root = $fs->revision_root (($hist->location($new_pool))[1],
-					$ppool);
-	    return ($root, $fs->revision_root ($hprev, $ppool), $hppath);
-	}
-
-	# Find nearest copy of the current revision (up to but *not*
-	# including the revision itself). If the copy contains us, bingo.
-	my $copy;
-	($root, $copy) = find_prev_copy ($fs, $hprev, $new_pool) or last; # no more copies
-	$rev = $root->revision_root_revision;
-	if (my ($fromrev, $frompath) = _copies_contain_path ($copy, $path)) {
-	    # there were copy, but the descendent might not exist there
-	    my $proot = $fs->revision_root ($fromrev, $ppool);
-	    last unless $proot->check_path ($frompath, $old_pool);
-	    return ($fs->revision_root($root->revision_root_revision, $ppool),
-		    $proot, $frompath);
-	}
-
-	if ($rev < $hprev) {
-	    # Reset the hprev root to this earlier revision to avoid infinite looping
-	    local $@;
-	    $hist = eval { $root->node_history ($path, $new_pool)->prev(0, $new_pool) } or last;
-	}
-        $old_pool->clear;
-	$spool->clear;
-        ($old_pool, $new_pool) = ($new_pool, $old_pool);
-    }
-    return;
-}
-
 sub _copies_contain_path {
     my ($copy, $path) = @_;
     my ($match) = grep { index ("$path/", "$_/") == 0 }

Modified: trunk/lib/SVK/Test.pm
==============================================================================
--- trunk/lib/SVK/Test.pm	(original)
+++ trunk/lib/SVK/Test.pm	Sat Nov 18 23:43:24 2006
@@ -115,8 +115,6 @@
     (defined &Win32::LoginName) ? Win32::LoginName() : ''
 ) || $ENV{USERNAME} || (getpwuid($<))[0];
 
-$ENV{SVNFSTYPE} ||= (($SVN::Core::VERSION =~ /^1\.0/) ? 'bdb' : 'fsfs');
-
 # Make "prove -l" happy; abs_path() returns "undef" if the path 
 # does not exist. This makes perl very unhappy.
 @INC = grep defined, map abs_path($_), @INC;
@@ -143,7 +141,7 @@
     }
     my $pool = SVN::Pool->new_default;
     $repos = SVN::Repos::create("$repospath", undef, undef, undef,
-				{'fs-type' => $ENV{SVNFSTYPE}})
+				{'fs-type' => $ENV{SVNFSTYPE} || 'fsfs'})
 	or die "failed to create repository at $repospath";
     return $repospath;
 }

Modified: trunk/lib/SVK/XD.pm
==============================================================================
--- trunk/lib/SVK/XD.pm	(original)
+++ trunk/lib/SVK/XD.pm	Sat Nov 18 23:43:24 2006
@@ -195,9 +195,8 @@
 
         make_path(dirname($path));
 
-        $ENV{SVNFSTYPE} ||= (($SVN::Core::VERSION =~ /^1\.0/) ? 'bdb' : 'fsfs');
 	SVN::Repos::create($path, undef, undef, undef,
-			   {'fs-type' => $ENV{SVNFSTYPE},
+			   {'fs-type' => $ENV{SVNFSTYPE} || 'fsfs',
 			    'bdb-txn-nosync' => '1',
 			    'bdb-log-autoremove' => '1'});
     }

Modified: trunk/t/05svm-lock.t
==============================================================================
--- trunk/t/05svm-lock.t	(original)
+++ trunk/t/05svm-lock.t	Sat Nov 18 23:43:24 2006
@@ -2,7 +2,6 @@
 use strict;
 use SVK::Test;
 use Time::HiRes 'sleep';
-plan (skip_all => "Test does not work with BDB") if $ENV{SVNFSTYPE} eq 'bdb';
 plan skip_all => "Doesn't work on win32" if $^O eq 'MSWin32';
 plan tests => 3;
 

Modified: trunk/t/50dav.t
==============================================================================
--- trunk/t/50dav.t	(original)
+++ trunk/t/50dav.t	Sat Nov 18 23:43:24 2006
@@ -17,7 +17,6 @@
     eval { require Apache::Test;
 	   $Apache::Test::VERSION >= 1.18 }
 	or plan (skip_all => "Apache::Test 1.18 required for testing dav");
-    plan (skip_all => "Test does not work with BDB") if $ENV{SVNFSTYPE} eq 'bdb';
 }
 setlocale (LC_CTYPE, $ENV{LC_CTYPE} = 'en_US.UTF-8')
     or plan skip_all => 'cannot set locale to en_US.UTF-8';

Modified: trunk/t/72sign.t
==============================================================================
--- trunk/t/72sign.t	(original)
+++ trunk/t/72sign.t	Sat Nov 18 23:43:24 2006
@@ -6,7 +6,6 @@
     local $SIG{__WARN__} = sub { 1 };
     plan skip_all => 'gnupg not found'
         unless (`gpg --version` || '') =~ /GnuPG/;
-    plan (skip_all => "Test does not work with BDB") if $ENV{SVNFSTYPE} eq 'bdb';
 }
 plan tests => 9;
 our $output;

Modified: trunk/t/mirror/dav-authz.t
==============================================================================
--- trunk/t/mirror/dav-authz.t	(original)
+++ trunk/t/mirror/dav-authz.t	Sat Nov 18 23:43:24 2006
@@ -17,7 +17,6 @@
     eval { require Apache::Test;
 	   $Apache::Test::VERSION >= 1.18 }
 	or plan (skip_all => "Apache::Test 1.18 required for testing dav");
-    plan (skip_all => "Test does not work with BDB") if $ENV{SVNFSTYPE} eq 'bdb';
 }
 setlocale (LC_CTYPE, $ENV{LC_CTYPE} = 'en_US.UTF-8')
     or plan skip_all => 'cannot set locale to en_US.UTF-8';


More information about the svk-commit mailing list