aboutsummaryrefslogtreecommitdiff
path: root/git-svnimport.perl
diff options
context:
space:
mode:
authorYaacov Akiba Slama <ya@slamail.org>2005-11-02 23:51:57 +0200
committerJunio C Hamano <junkio@cox.net>2005-11-08 01:24:47 -0800
commitfcfa32b9e10b3c0373a263a732146850bdf67242 (patch)
treeff2020faa4494ccd3744378604e5148bfd915d49 /git-svnimport.perl
parent4bfb6b62ffc9460798ebc78c3a30e4eff7c409d0 (diff)
downloadgit-fcfa32b9e10b3c0373a263a732146850bdf67242.tar.gz
git-fcfa32b9e10b3c0373a263a732146850bdf67242.tar.xz
Use svn pools to solve the memory leak problem.
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svnimport.perl')
-rwxr-xr-xgit-svnimport.perl8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 45b6a1986..5bf9ef21e 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -112,7 +112,9 @@ sub file {
DIR => File::Spec->tmpdir(), UNLINK => 1);
print "... $rev $path ...\n" if $opt_v;
- eval { $self->{'svn'}->get_file($path,$rev,$fh); };
+ my $pool = SVN::Pool->new();
+ eval { $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
+ $pool->clear;
if($@) {
return undef if $@ =~ /Attempted to get checksum/;
die $@;
@@ -674,7 +676,9 @@ sub commit_all {
}
while(++$current_rev <= $svn->{'maxrev'}) {
- $svn->{'svn'}->get_log("/",$current_rev,$current_rev,$current_rev,1,1,\&_commit_all,"");
+ my $pool=SVN::Pool->new;
+ $svn->{'svn'}->get_log("/",$current_rev,$current_rev,1,1,1,\&_commit_all,$pool);
+ $pool->clear;
commit_all();
if($opt_l and not --$opt_l) {
print STDERR "Stopping, because there is a memory leak (in the SVN library).\n";