diff options
author | David D. Kilzer <ddkilzer@kilzer.net> | 2007-11-21 11:57:19 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-11-21 20:11:11 -0800 |
commit | 8b014d7157d29ce76b0f631e19c6e2ce9aeb2366 (patch) | |
tree | 311ed5ae6d61e3b5f6b024239ce173695a75b37a /git-svn.perl | |
parent | e6fefa926de3fcc1f0424e1b901347379ed51935 (diff) | |
download | git-8b014d7157d29ce76b0f631e19c6e2ce9aeb2366.tar.gz git-8b014d7157d29ce76b0f631e19c6e2ce9aeb2366.tar.xz |
git-svn: info --url [path]
Return the svn URL for the given path, or return the svn
repository URL if no path is given.
Added 18 tests to t/t9119-git-svn-info.sh.
Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl index fd1036104..7d86870ee 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -65,7 +65,7 @@ my ($_stdin, $_help, $_edit, $_template, $_shared, $_version, $_fetch_all, $_no_rebase, $_merge, $_strategy, $_dry_run, $_local, - $_prefix, $_no_checkout, $_verbose); + $_prefix, $_no_checkout, $_url, $_verbose); $Git::SVN::_follow_parent = 1; my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username, 'config-dir=s' => \$Git::SVN::Ra::config_dir, @@ -181,7 +181,7 @@ my %cmd = ( 'info' => [ \&cmd_info, "Show info about the latest SVN revision on the current branch", - { } ], + { 'url' => \$_url, } ], ); my $cmd; @@ -773,6 +773,11 @@ sub cmd_info { } my $full_url = $url . ($path eq "." ? "" : "/$path"); + if ($_url) { + print $full_url, "\n"; + return; + } + my $result = "Path: $path\n"; $result .= "Name: " . basename($path) . "\n" if $file_type ne "dir"; $result .= "URL: " . $full_url . "\n"; |