git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] git-svn: use commiturl in preference to url when constructing dst for branch/tag
@ 2010-01-11 16:21 Igor Mironov
  0 siblings, 0 replies; only message in thread
From: Igor Mironov @ 2010-01-11 16:21 UTC (permalink / raw)
  To: git; +Cc: Eric Wong

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.
Signed-off-by: Igor Mironov <igor.a.mironov@gmail.com>
---
 git-svn.perl |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 3f7ccc1..3bdd8d3 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -708,7 +708,17 @@ sub cmd_branch {
 		}
 	}
 	my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
-	my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());
+	my $url;
+	if (defined $_commit_url) {
+		$url = $_commit_url;
+	} else {
+		$url = eval { command_oneline('config', '--get',
+			"svn-remote.$gs->{repo_id}.commiturl") };
+		if (!$url) {
+			$url = $remote->{url};
+		}
+	}
+	my $dst = join '/', $url, $lft, $branch_name, ($rgt || ());
 
 	if ($dst=~"^https:" && $src=~"^http:") {
 		$src=~s/^http:/https:/;
-- 
1.6.6.106.ge2de8

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-11 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 16:21 [PATCH 2/4] git-svn: use commiturl in preference to url when constructing dst for branch/tag Igor Mironov

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).