@matheusbsbs / matheus-bagliano / commits / 0df84059d4
Fork 0

git-svn: read the dcommit url from the config file on a per remote basis

The commit url for dcommit is determined in the following order: commandline option --commit-url svn.commiturl svn-remote.<name>.commiturl svn-remote.<name>.url Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de> Acked-by: Eric Wong <normalperson@yhbt.net>

Peter Oberndorfer committed Feb 23, 2009 at 12:02 UTC 0df84059d4127ed06e040998ec0e6ce6f61d3d1f
2 files changed +15 -1
Documentation/git-svn.txt
+4
@@ -169,6 +169,10 @@ and have no uncommitted changes.
169 reused if a user is later given access to an alternate transport
170 method (e.g. `svn+ssh://` or `https://`) for commit.
171
172 +config key: svn-remote.<name>.commiturl
173 +
174 +config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
175 +
176 Using this option for any other purpose (don't ask)
177 is very strongly discouraged.
178 --
git-svn.perl
+11 -1
@@ -438,7 +438,17 @@ sub cmd_dcommit {
438 die "Unable to determine upstream SVN information from ",
439 "$head history.\nPerhaps the repository is empty.";
440 }
441 - $url = defined $_commit_url ? $_commit_url : $gs->full_url;
441 +
442 + if (defined $_commit_url) {
443 + $url = $_commit_url;
444 + } else {
445 + $url = eval { command_oneline('config', '--get',
446 + "svn-remote.$gs->{repo_id}.commiturl") };
447 + if (!$url) {
448 + $url = $gs->full_url
449 + }
450 + }
451 +
452 my $last_rev = $_revision if defined $_revision;
453 if ($url) {
454 print "Committing to $url ...\n";