Commits

Anonymous committed 731651f Merge

Merge branch 'ff/svnimport'

* ff/svnimport:
git-svnimport: Improved detection of merges.

  • Participants
  • Parent commits b0d6e64, 65160b8

Comments (0)

Files changed (1)

File git-svnimport.perl

 
 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