{"thread":{"id":"6762","subject":"[PATCH] git-svn: detect SVN::Mirror breadcrumbs on multi-init","startedAt":"2007-02-10T23:15:11Z","lastAt":"2007-02-10T23:15:11Z","messageCount":1,"participants":["Sam Vilain"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34144","messageId":"20070210233735.96EBF13A382@magnus.utsl.gen.nz","threadId":"6762","inReplyTo":null,"subject":"[PATCH] git-svn: detect SVN::Mirror breadcrumbs on multi-init","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2007-02-10T23:15:11Z","receivedAt":"2007-02-10T23:15:11Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"SVN::Mirror leaves a little directory property on the root of its\nmirrored paths to say the URL and repository UUID of the path that\nthis path mirrors.  If we see them, save them in the config for later\nuse.\n---\n git-svn.perl |   28 +++++++++++++++++++++++++++-\n 1 files changed, 27 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 0c36e8b..59d9faf 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -358,8 +358,34 @@ sub cmd_multi_init {\n \t\t\t\t\t\t   undef, $trunk_ref);\n \t\t}\n \t}\n+\tmy $ra;\n+\tif ($url) {\n+\t\t$ra = Git::SVN::Ra->new($url);\n+\t\tmy $r = $ra->get_latest_revnum;\n+\t\tmy (undef, undef, $props) = $ra->get_dir('', $r);\n+\t\tif ( my $src = $props->{'svm:source'} ) {\n+\t\t\t# don't know wtf a ! is there for, also the\n+\t\t\t# username is of no interest\n+\t\t\t$src =~ s{!$}{};\n+\t\t\t$src =~ s{(^[a-z\\+]*://)[^/@]*@}{$1};\n+\n+\t\t\t# XXX - is this right?\n+\t\t\tmy $remote_id = $Git::SVN::default_repo_id;\n+\t\t\tmy $section = \"svn-remote.$remote_id\";\n+\n+\t\t\tprint STDERR \"SVN::Mirror breadcrumbs detected:\\n\",\n+\t\t\t    \"    $src => $url\\n\";\n+\n+\t\t\t# store the source as a repo-config item\n+\t\t\tcommand_noisy('config', \"$section.source\", $src);\n+\n+\t\t\tmy $uuid = $props->{'svm:uuid'};\n+\t\t\t$uuid =~ m{^[0-9a-f\\-]{30,}$}\n+\t\t\t    or croak \"doesn't look right - svm:uuid is '$uuid'\";\n+\t\t\tcommand_noisy('config', \"$section.uuid\", $uuid);\n+\t\t}\n+\t}\n \treturn unless defined $_branches || defined $_tags;\n-\tmy $ra = $url ? Git::SVN::Ra->new($url) : undef;\n \tcomplete_url_ls_init($ra, $_branches, '--branches/-b', $_prefix);\n \tcomplete_url_ls_init($ra, $_tags, '--tags/-t', $_prefix . 'tags/');\n }\n-- \n1.5.0.rc3.g3e023\n"}]}