{"thread":{"id":"22166","subject":"[PATCH 2/4] git-svn: use commiturl in preference to url when constructing dst for branch/tag","startedAt":"2010-01-11T16:21:23Z","lastAt":"2010-01-11T16:21:23Z","messageCount":1,"participants":["Igor Mironov"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"131287","messageId":"4B4B5003.6070003@gmail.com","threadId":"22166","inReplyTo":null,"subject":"[PATCH 2/4] git-svn: use commiturl in preference to url when constructing dst for branch/tag","fromName":"Igor Mironov","fromEmail":"igor.a.mironov@gmail.com","sentAt":"2010-01-11T16:21:23Z","receivedAt":"2010-01-11T16:21:23Z","isPatch":true,"sender":{"key":"igor.a.mironov@gmail.com","avatar":null},"body":"When constructing a destination URL, use the property 'commiturl' if it is specified in the configuration file; otherwise take 'url' as usual.  This accommodates the scenario where a user only wants to involve the writable repository in operations performing a commit and defaults everything else to a read-only URL.\nSigned-off-by: Igor Mironov <igor.a.mironov@gmail.com>\n---\n git-svn.perl |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 3f7ccc1..3bdd8d3 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -708,7 +708,17 @@ sub cmd_branch {\n \t\t}\n \t}\n \tmy ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};\n-\tmy $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());\n+\tmy $url;\n+\tif (defined $_commit_url) {\n+\t\t$url = $_commit_url;\n+\t} else {\n+\t\t$url = eval { command_oneline('config', '--get',\n+\t\t\t\"svn-remote.$gs->{repo_id}.commiturl\") };\n+\t\tif (!$url) {\n+\t\t\t$url = $remote->{url};\n+\t\t}\n+\t}\n+\tmy $dst = join '/', $url, $lft, $branch_name, ($rgt || ());\n \n \tif ($dst=~\"^https:\" && $src=~\"^http:\") {\n \t\t$src=~s/^http:/https:/;\n-- \n1.6.6.106.ge2de8\n"}]}