X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-svnimport.perl;h=38ac732ca9b677a5647a96db44f7133b47db0648;hb=e968751573a4ded76201a0e4414ec36649a92dda;hp=61f559f0a8ae69c04cfe9d8700591cedda41989c;hpb=d598075e52634665bd25a80b085e300d338d21f5;p=git.git diff --git a/git-svnimport.perl b/git-svnimport.perl index 61f559f0..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