git-svn: prepare SVN::Ra config pieces once
[gitweb.git] / perl / Git / SVN.pm
index 171af37f4a66f9be500148720c8f4b7f036338d5..5f9d4690bb53463534a7b9c5e3695a26fdb8981a 100644 (file)
@@ -1600,7 +1600,6 @@ sub tie_for_persistent_memoization {
                my %lookup_svn_merge_cache;
                my %check_cherry_pick2_cache;
                my %has_no_changes_cache;
-               my %_rev_list_cache;
 
                tie_for_persistent_memoization(\%lookup_svn_merge_cache,
                    "$cache_path/lookup_svn_merge");
@@ -1622,14 +1621,6 @@ sub tie_for_persistent_memoization {
                        SCALAR_CACHE => ['HASH' => \%has_no_changes_cache],
                        LIST_CACHE => 'FAULT',
                ;
-
-               tie_for_persistent_memoization(\%_rev_list_cache,
-                   "$cache_path/_rev_list");
-               memoize '_rev_list',
-                       SCALAR_CACHE => 'FAULT',
-                       LIST_CACHE => ['HASH' => \%_rev_list_cache],
-               ;
-
        }
 
        sub unmemoize_svn_mergeinfo_functions {
@@ -1639,7 +1630,6 @@ sub tie_for_persistent_memoization {
                Memoize::unmemoize 'lookup_svn_merge';
                Memoize::unmemoize 'check_cherry_pick2';
                Memoize::unmemoize 'has_no_changes';
-               Memoize::unmemoize '_rev_list';
        }
 
        sub clear_memoized_mergeinfo_caches {
@@ -1710,38 +1700,20 @@ sub mergeinfo_changes {
        my %minfo = map {split ":", $_ } split "\n", $mergeinfo_prop;
        my $old_minfo = {};
 
-       # Initialize cache on the first call.
-       unless (defined $self->{cached_mergeinfo_rev}) {
-               $self->{cached_mergeinfo_rev} = {};
-               $self->{cached_mergeinfo} = {};
+       my $ra = $self->ra;
+       # Give up if $old_path isn't in the repo.
+       # This is probably a merge on a subtree.
+       if ($ra->check_path($old_path, $old_rev) != $SVN::Node::dir) {
+               warn "W: ignoring svn:mergeinfo on $old_path, ",
+                       "directory didn't exist in r$old_rev\n";
+               return {};
+       }
+       my (undef, undef, $props) = $ra->get_dir($old_path, $old_rev);
+       if (defined $props->{"svn:mergeinfo"}) {
+               my %omi = map {split ":", $_ } split "\n",
+                       $props->{"svn:mergeinfo"};
+               $old_minfo = \%omi;
        }
-
-       my $cached_rev = $self->{cached_mergeinfo_rev}{$old_path};
-       if (defined $cached_rev && $cached_rev == $old_rev) {
-               $old_minfo = $self->{cached_mergeinfo}{$old_path};
-       } else {
-               my $ra = $self->ra;
-               # Give up if $old_path isn't in the repo.
-               # This is probably a merge on a subtree.
-               if ($ra->check_path($old_path, $old_rev) != $SVN::Node::dir) {
-                       warn "W: ignoring svn:mergeinfo on $old_path, ",
-                               "directory didn't exist in r$old_rev\n";
-                       return {};
-               }
-               my (undef, undef, $props) =
-                       $self->ra->get_dir($old_path, $old_rev);
-               if (defined $props->{"svn:mergeinfo"}) {
-                       my %omi = map {split ":", $_ } split "\n",
-                               $props->{"svn:mergeinfo"};
-                       $old_minfo = \%omi;
-               }
-               $self->{cached_mergeinfo}{$old_path} = $old_minfo;
-               $self->{cached_mergeinfo_rev}{$old_path} = $old_rev;
-       }
-
-       # Cache the new mergeinfo.
-       $self->{cached_mergeinfo}{$path} = \%minfo;
-       $self->{cached_mergeinfo_rev}{$path} = $rev;
 
        my %changes = ();
        foreach my $p (keys %minfo) {