diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-01-18 18:22:18 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-02-23 00:57:09 -0800 |
commit | f6f0987646069bff3a7674aca257fd84f939d960 (patch) | |
tree | 6ac6059504cd53703e1c747e8d902633db789d39 /git-svn.perl | |
parent | git-svn: fix a regression in dcommit that caused empty log messages (diff) | |
download | tgif-f6f0987646069bff3a7674aca257fd84f939d960.tar.xz |
git-svn: reuse open SVN::Ra connections by URL
Note: this can cause problems with Perl's reference counting GC,
so I'm disabling Git::SVN::Ra::DESTROY. If we notice more
problems down the line, we can disable this enhancement.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git-svn.perl b/git-svn.perl index b5a4cb05a6..4084e0657b 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2015,6 +2015,7 @@ use vars qw/@ISA $config_dir/; use strict; use warnings; my ($can_do_switch); +my %RA; BEGIN { # enforce temporary pool usage for some simple functions @@ -2033,6 +2034,9 @@ BEGIN { sub new { my ($class, $url) = @_; + $url =~ s!/+$!!; + return $RA{$url} if $RA{$url}; + SVN::_Core::svn_config_ensure($config_dir, undef); my ($baton, $callbacks) = SVN::Core::auth_open_helper([ SVN::Client::get_simple_provider(), @@ -2057,13 +2061,11 @@ sub new { $self->{svn_path} = $url; $self->{repos_root} = $self->get_repos_root; $self->{svn_path} =~ s#^\Q$self->{repos_root}\E/*##; - bless $self, $class; + $RA{$url} = bless $self, $class; } sub DESTROY { - my $self = shift; - $self->{pool}->clear if $self->{pool}; - $self->SUPER::DESTROY(@_); + # do not call the real DESTROY since we store ourselves in %RA } sub dup { |