git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Dangel <uli@spamt.net>
To: git@vger.kernel.org
Cc: Ulrich Dangel <uli@spamt.net>
Subject: [PATCH] Canonicalize svn urls to prevent libsvn assertion
Date: Fri, 26 Jun 2009 16:52:09 +0200	[thread overview]
Message-ID: <1246027929-2792-1-git-send-email-uli@spamt.net> (raw)

Cloning/initializing svn repositories with an uncanonicalize url does not
work as libsvn throws an assertion. This patch canonicalize svn uris for the
clone and init command from git-svn.

Signed-off-by: Ulrich Dangel <uli@spamt.net>
---
 git-svn.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 3301797..5130a8c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -380,6 +380,7 @@ sub cmd_init {
 	}
 	my $url = shift or die "SVN repository location required ",
 	                       "as a command-line argument\n";
+	$url = canonicalize_url($url);
 	init_subdir(@_);
 	do_git_init_db();
 
@@ -741,6 +742,12 @@ sub canonicalize_path {
 	return $path;
 }
 
+sub canonicalize_url {
+	my ($url) = @_;
+	$url =~ s#^([^:]+://[^/]*/)(.*)$#$1 . canonicalize_path($2)#e;
+	return $url;
+}
+
 # get_svnprops(PATH)
 # ------------------
 # Helper for cmd_propget and cmd_proplist below.
@@ -810,7 +817,7 @@ sub cmd_multi_init {
 
 	$_prefix = '' unless defined $_prefix;
 	if (defined $url) {
-		$url =~ s#/+$##;
+		$url = canonicalize_url($url);    
 		init_subdir(@_);
 	}
 	do_git_init_db();
-- 
1.6.3.1

             reply	other threads:[~2009-06-26 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 14:52 Ulrich Dangel [this message]
2009-06-26 21:49 ` [PATCH] Canonicalize svn urls to prevent libsvn assertion 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

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

  git send-email \
    --in-reply-to=1246027929-2792-1-git-send-email-uli@spamt.net \
    --to=uli@spamt.net \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).