Browse Source

Merge branch 'master' of git://git.bogomips.org/git-svn

* 'master' of git://git.bogomips.org/git-svn:
  git-svn: ignore leading blank lines in svn:ignore
  svn: Honor --prefix option in init without --stdlayout
  svn: Add && to t9107-git-svn-migrate.sh
maint
Junio C Hamano 16 years ago
parent
commit
f402a7b172
  1. 5
      git-svn.perl
  2. 5
      t/t9101-git-svn-props.sh
  3. 14
      t/t9107-git-svn-migrate.sh

5
git-svn.perl

@ -764,6 +764,7 @@ sub cmd_show_ignore { @@ -764,6 +764,7 @@ sub cmd_show_ignore {
print STDOUT "\n# $path\n";
my $s = $props->{'svn:ignore'} or return;
$s =~ s/[\r\n]+/\n/g;
$s =~ s/^\n+//;
chomp $s;
$s =~ s#^#$path#gm;
print STDOUT "$s\n";
@ -801,6 +802,7 @@ sub cmd_create_ignore { @@ -801,6 +802,7 @@ sub cmd_create_ignore {
open(GITIGNORE, '>', $ignore)
or fatal("Failed to open `$ignore' for writing: $!");
$s =~ s/[\r\n]+/\n/g;
$s =~ s/^\n+//;
chomp $s;
# Prefix all patterns so that the ignore doesn't apply
# to sub-directories.
@ -3317,7 +3319,8 @@ sub _new { @@ -3317,7 +3319,8 @@ sub _new {
$repo_id = $Git::SVN::default_repo_id;
}
unless (defined $ref_id && length $ref_id) {
$_[2] = $ref_id = $Git::SVN::default_ref_id;
$_prefix = '' unless defined($_prefix);
$_[2] = $ref_id = $_prefix . $Git::SVN::default_ref_id;
}
$_[1] = $repo_id;
my $dir = "$ENV{GIT_DIR}/svn/$ref_id";

5
t/t9101-git-svn-props.sh

@ -142,7 +142,9 @@ test_expect_success 'test show-ignore' " @@ -142,7 +142,9 @@ test_expect_success 'test show-ignore' "
touch deeply/nested/directory/.keep &&
svn_cmd add deeply &&
svn_cmd up &&
svn_cmd propset -R svn:ignore 'no-such-file*' .
svn_cmd propset -R svn:ignore '
no-such-file*
' .
svn_cmd commit -m 'propset svn:ignore'
cd .. &&
git svn show-ignore > show-ignore.got &&
@ -171,6 +173,7 @@ test_expect_success 'test create-ignore' " @@ -171,6 +173,7 @@ test_expect_success 'test create-ignore' "
"

cat >prop.expect <<\EOF

no-such-file*

EOF

14
t/t9107-git-svn-migrate.sh

@ -56,7 +56,15 @@ test_expect_success 'initialize a multi-repository repo' ' @@ -56,7 +56,15 @@ test_expect_success 'initialize a multi-repository repo' '
git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
for i in tags/0.1 tags/0.2 tags/0.3; do
git config --add svn-remote.svn.fetch \
$i:refs/remotes/$i || exit 1; done
$i:refs/remotes/$i || exit 1; done &&
git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/trunk$" fetch.out &&
grep "^branches/a:refs/remotes/a$" fetch.out &&
grep "^branches/b:refs/remotes/b$" fetch.out &&
grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
grep "^:refs/${remotes_git_svn}" fetch.out
'

# refs should all be different, but the trees should all be the same:
@ -86,14 +94,14 @@ test_expect_success 'migrate --minimize on old inited layout' ' @@ -86,14 +94,14 @@ test_expect_success 'migrate --minimize on old inited layout' '
echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
done &&
git svn migrate --minimize &&
test -z "`git config -l |grep -v "^svn-remote\.git-svn\."`" &&
test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/trunk$" fetch.out &&
grep "^branches/a:refs/remotes/a$" fetch.out &&
grep "^branches/b:refs/remotes/b$" fetch.out &&
grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out
grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
grep "^:refs/${remotes_git_svn}" fetch.out
'


Loading…
Cancel
Save