* [PATCH] Canonicalize svn urls to prevent libsvn assertion
@ 2009-06-26 14:52 Ulrich Dangel
2009-06-26 21:49 ` Eric Wong
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Dangel @ 2009-06-26 14:52 UTC (permalink / raw)
To: git; +Cc: Ulrich Dangel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Canonicalize svn urls to prevent libsvn assertion
2009-06-26 14:52 [PATCH] Canonicalize svn urls to prevent libsvn assertion Ulrich Dangel
@ 2009-06-26 21:49 ` Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2009-06-26 21:49 UTC (permalink / raw)
To: Ulrich Dangel; +Cc: git
Ulrich Dangel <uli@spamt.net> wrote:
> 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>
Thanks,
I'm not getting any assertions in my version of SVN (1.5.1) but it
actually does cause issues with path stripping when following
repositories.
Acked-by: Eric Wong <normalperson@yhbt.net>
..and pushed out to git://git.bogomips.org/git-svn
There was a minor trailing whitespace issue which I fixed, too
--
Eric Wong
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-26 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 14:52 [PATCH] Canonicalize svn urls to prevent libsvn assertion Ulrich Dangel
2009-06-26 21:49 ` Eric Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.