X-Git-Url: https://git.octo.it/?p=git.git;a=blobdiff_plain;f=git-svnimport.perl;h=38ac732ca9b677a5647a96db44f7133b47db0648;hp=60ed7ae3ee450878d8ef6dc3bf1f60670d1078d3;hb=HEAD;hpb=24735cfc500feb2a8dba9f140080ab3476363d28 diff --git a/git-svnimport.perl b/git-svnimport.perl index 60ed7ae3..38ac732c 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -63,10 +63,17 @@ my $svn_dir = $ARGV[1]; our @mergerx = (); if ($opt_m) { - @mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i ); + my $branch_esc = quotemeta ($branch_name); + my $trunk_esc = quotemeta ($trunk_name); + @mergerx = + ( + qr!\b(?:merg(?:ed?|ing))\b.*?\b((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i, + qr!\b(?:from|of)\W+((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i, + qr!\b(?:from|of)\W+(?:the )?([\w\.\-]+)[-\s]branch\b!i + ); } if ($opt_M) { - push (@mergerx, qr/$opt_M/); + unshift (@mergerx, qr/$opt_M/); } # Absolutize filename now, since we will have chdir'ed by the time we @@ -136,8 +143,10 @@ sub file { print "... $rev $path ...\n" if $opt_v; my (undef, $properties); + my $pool = SVN::Pool->new(); eval { (undef, $properties) - = $self->{'svn'}->get_file($path,$rev,$fh); }; + = $self->{'svn'}->get_file($path,$rev,$fh,$pool); }; + $pool->clear; if($@) { return undef if $@ =~ /Attempted to get checksum/; die $@;