summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d5100c)
raw | patch | inline | side by side (parent: 8d5100c)
author | Thomas Rast <trast@student.ethz.ch> | |
Tue, 26 Aug 2008 19:32:36 +0000 (21:32 +0200) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 5 Sep 2008 23:58:39 +0000 (16:58 -0700) |
Previously 'git svn info <path>' would always treat the <path> as
relative to the working directory root, with a default of ".". This
does not match the behaviour of 'svn info'. Prepend $(git rev-parse
--show-prefix) to the path used inside cmd_info to make it relative to
the current working directory.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
relative to the working directory root, with a default of ".". This
does not match the behaviour of 'svn info'. Prepend $(git rev-parse
--show-prefix) to the path used inside cmd_info to make it relative to
the current working directory.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9119-git-svn-info.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 484b4ab0da9fd907645e84559a6847b954997165..5e61dd9c12794043a44044ac09c9fcc1c75bc606 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
sub cmd_info {
my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
+ my $fullpath = canonicalize_path($cmd_dir_prefix . $path);
if (exists $_[1]) {
die "Too many arguments specified\n";
}
# canonicalize_path() will return "" to make libsvn 1.5.x happy,
$path = "." if $path eq "";
- my $full_url = $url . ($path eq "." ? "" : "/$path");
+ my $full_url = $url . ($fullpath eq "" ? "" : "/$fullpath");
if ($_url) {
print $full_url, "\n";
}
my ($lc_author, $lc_rev, $lc_date_utc);
- my @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, "--", $path);
+ my @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, "--", $fullpath);
my $log = command_output_pipe(@args);
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
while (<$log>) {
index 821507d416b5e4d386248fb21b907bf5cd9895a4..8709bcc49cfbc90579bd823d6dff7f050ce5d39f 100755 (executable)
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
ln -s directory symlink-directory &&
svn import -m "initial" . "$svnrepo" &&
cd .. &&
+ svn co "$svnrepo" svnwc &&
+ cd svnwc &&
+ echo foo > foo &&
+ svn add foo &&
+ svn commit -m "change outside directory" &&
+ svn update &&
+ cd .. &&
mkdir gitwc &&
cd gitwc &&
git-svn init "$svnrepo" &&
git-svn fetch &&
cd .. &&
- svn co "$svnrepo" svnwc &&
ptouch gitwc/file svnwc/file &&
ptouch gitwc/directory svnwc/directory &&
ptouch gitwc/symlink-file svnwc/symlink-file &&
test_cmp expected.info-directory actual.info-directory
"
+test_expect_success 'info inside directory' "
+ (cd svnwc/directory; svn info) > expected.info-inside-directory &&
+ (cd gitwc/directory; git-svn info) > actual.info-inside-directory &&
+ test_cmp expected.info-inside-directory actual.info-inside-directory
+ "
+
test_expect_success 'info --url directory' '
test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory"
'