diff options
author | Junio C Hamano <junkio@cox.net> | 2006-06-03 23:58:26 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-03 23:58:26 -0700 |
commit | 731651fe25a7d7a242584e4b85112a610c32a23f (patch) | |
tree | 4f075c7c075b5f14f752484993ece4d077e29df5 | |
parent | read-tree --reset: update working tree file for conflicted paths. (diff) | |
parent | git-svnimport: Improved detection of merges. (diff) | |
download | tgif-731651fe25a7d7a242584e4b85112a610c32a23f.tar.xz |
Merge branch 'ff/svnimport'
* ff/svnimport:
git-svnimport: Improved detection of merges.
-rwxr-xr-x | git-svnimport.perl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl index 61f559f0a8..38ac732ca9 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 |