summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-04 06:58:26 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-04 06:58:26 (GMT)
commit731651fe25a7d7a242584e4b85112a610c32a23f (patch)
tree4f075c7c075b5f14f752484993ece4d077e29df5
parentb0d6e64629aeba96e837972c0fda5e61eebb7ab1 (diff)
parent65160b8b04f814ab5b2573b32605320ff875f99e (diff)
downloadgit-731651fe25a7d7a242584e4b85112a610c32a23f.zip
git-731651fe25a7d7a242584e4b85112a610c32a23f.tar.gz
git-731651fe25a7d7a242584e4b85112a610c32a23f.tar.bz2
Merge branch 'ff/svnimport'
* ff/svnimport: git-svnimport: Improved detection of merges.
-rwxr-xr-xgit-svnimport.perl11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 61f559f0..38ac732 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