git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tommaso Colombo <tommaso.colombo@outlook.com>
To: git@vger.kernel.org
Cc: Tommaso Colombo <zibo86@hotmail.com>
Subject: [PATCH] git-svn: merge: fix rooturl/branchurl match check
Date: Wed, 15 Oct 2014 14:39:01 +0200	[thread overview]
Message-ID: <BLU437-SMTP152A16338E427B250EB601FBAA0@phx.gbl> (raw)

When populating svn:mergeinfo, git-svn merge checks if the merge parent
of the merged branch is under the same root as the git-svn repository.
This was implemented comparing $gs->repos_root with the return value of
of cmt_metadata for the merge parent. However, the first may contain a
username, whereas the second does not. In this case the comparison
fails.

Remove the username from $gs->repos_root before performing the
comparison.
---
 git-svn.perl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index b6e2186..0a5a5ff 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -707,7 +707,8 @@ sub populate_merge_info {
 		my $all_parents_ok = 1;
 		my $aggregate_mergeinfo = '';
 		my $rooturl = $gs->repos_root;
-		my ($target_branch) = $gs->full_pushurl =~ /^\Q$rooturl\E(.*)/;
+		Git::SVN::remove_username($rooturl);
+		my $target_branch = $gs->path;
 
 		if (defined($rewritten_parent)) {
 			# Replace first parent with newly-rewritten version
@@ -729,7 +730,7 @@ sub populate_merge_info {
 			}
 			my $branchpath = $1;
 
-			my $ra = Git::SVN::Ra->new($branchurl);
+			my $ra = Git::SVN::Ra->new(add_path_to_url($gs->repos_root, $branchpath));
 			my (undef, undef, $props) =
 				$ra->get_dir(canonicalize_path("."), $svnrev);
 			my $par_mergeinfo = $props->{'svn:mergeinfo'};
@@ -921,6 +922,7 @@ sub cmd_dcommit {
 		# information from different SVN repos, and paths
 		# which are not underneath this repository root.
 		my $rooturl = $gs->repos_root;
+		Git::SVN::remove_username($rooturl);
 		foreach my $d (@$linear_refs) {
 			my %parentshash;
 			read_commit_parents(\%parentshash, $d);
-- 
2.1.2.443.g670a3c1.dirty

             reply	other threads:[~2014-10-15 12:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 12:39 Tommaso Colombo [this message]
2014-10-20  6:24 ` [PATCH] git-svn: merge: fix rooturl/branchurl match check Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLU437-SMTP152A16338E427B250EB601FBAA0@phx.gbl \
    --to=tommaso.colombo@outlook.com \
    --cc=git@vger.kernel.org \
    --cc=zibo86@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).