diff options
author | Eric Wong <normalperson@yhbt.net> | 2014-10-21 06:23:22 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2014-10-24 22:55:43 +0000 |
commit | 2b6c613f1a873555475050bd8f5a22828f0d03a3 (patch) | |
tree | 0cad84e97f0f24bdf42617bcd448d76158f8b0df /perl/Git/SVN.pm | |
parent | git-svn: cache only mergeinfo revisions (diff) | |
download | tgif-2b6c613f1a873555475050bd8f5a22828f0d03a3.tar.xz |
git-svn: remove mergeinfo rev caching
This should further reduce memory usage from the new mergeinfo
speedups without hurting performance too much, assuming
reasonable latency to the SVN server.
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Suggested-by: Jakob Stoklund Olesen <stoklund@2pi.dk>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'perl/Git/SVN.pm')
-rw-r--r-- | perl/Git/SVN.pm | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index f8a75b190c..4364506ca2 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -1710,32 +1710,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} = {}; - } - - my $cached_rev = $self->{cached_mergeinfo_rev}{$old_path}; - unless (defined $cached_rev && $cached_rev == $old_rev) { - 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); + 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; } - $self->{cached_mergeinfo_rev}{$old_path} = $old_rev; - - # Cache the new mergeinfo. - $self->{cached_mergeinfo_rev}{$path} = $rev; my %changes = (); foreach my $p (keys %minfo) { |