Skip to content

Commit 2b6c613

Browse files
author
Eric Wong
committed
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 <[email protected]> Suggested-by: Jakob Stoklund Olesen <[email protected]> Signed-off-by: Eric Wong <[email protected]>
1 parent 54b9534 commit 2b6c613

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

perl/Git/SVN.pm

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,32 +1710,20 @@ sub mergeinfo_changes {
17101710
my %minfo = map {split ":", $_ } split "\n", $mergeinfo_prop;
17111711
my $old_minfo = {};
17121712

1713-
# Initialize cache on the first call.
1714-
unless (defined $self->{cached_mergeinfo_rev}) {
1715-
$self->{cached_mergeinfo_rev} = {};
1716-
}
1717-
1718-
my $cached_rev = $self->{cached_mergeinfo_rev}{$old_path};
1719-
unless (defined $cached_rev && $cached_rev == $old_rev) {
1720-
my $ra = $self->ra;
1721-
# Give up if $old_path isn't in the repo.
1722-
# This is probably a merge on a subtree.
1723-
if ($ra->check_path($old_path, $old_rev) != $SVN::Node::dir) {
1724-
warn "W: ignoring svn:mergeinfo on $old_path, ",
1725-
"directory didn't exist in r$old_rev\n";
1726-
return {};
1727-
}
1728-
}
1729-
my (undef, undef, $props) = $self->ra->get_dir($old_path, $old_rev);
1713+
my $ra = $self->ra;
1714+
# Give up if $old_path isn't in the repo.
1715+
# This is probably a merge on a subtree.
1716+
if ($ra->check_path($old_path, $old_rev) != $SVN::Node::dir) {
1717+
warn "W: ignoring svn:mergeinfo on $old_path, ",
1718+
"directory didn't exist in r$old_rev\n";
1719+
return {};
1720+
}
1721+
my (undef, undef, $props) = $ra->get_dir($old_path, $old_rev);
17301722
if (defined $props->{"svn:mergeinfo"}) {
17311723
my %omi = map {split ":", $_ } split "\n",
17321724
$props->{"svn:mergeinfo"};
17331725
$old_minfo = \%omi;
17341726
}
1735-
$self->{cached_mergeinfo_rev}{$old_path} = $old_rev;
1736-
1737-
# Cache the new mergeinfo.
1738-
$self->{cached_mergeinfo_rev}{$path} = $rev;
17391727

17401728
my %changes = ();
17411729
foreach my $p (keys %minfo) {

0 commit comments

Comments
 (0)