2007-02-17 11:53:07 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Eric Wong
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='git-svn useSvmProps test'
|
|
|
|
|
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
|
|
|
test_expect_success 'load svm repo' "
|
|
|
|
svnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&
|
git-svn: don't attempt to minimize URLs by default
For tracking branches and tags, git-svn prefers to connect
to the root of the repository or at least the level that
houses branches and tags as well as trunk. However, users
that are accustomed to tracking a single directory have
no use for this feature.
As pointed out by Junio, users may not have permissions to
connect to connect to a higher-level path in the repository.
While the current minimize_url() function detects lack of
permissions to certain paths _after_ successful logins, it
cannot effectively determine if it is trying to access a
login-only portion of a repo when the user expects to
connect to a part where anonymous access is allowed.
For people used to the git-svnimport switches of
--trunk, --tags, --branches, they'll already pass the
repository root (or root+subdirectory), so minimize URL
isn't of too much use to them, either.
For people *not* used to git-svnimport, git-svn also
supports:
git svn init --minimize-url \
--trunk http://repository-root/foo/trunk \
--branches http://repository-root/foo/branches \
--tags http://repository-root/foo/tags
And this is where the new --minimize-url command-line switch
comes in to allow for this behavior to continue working.
2007-05-13 18:58:14 +02:00
|
|
|
git-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&
|
|
|
|
git-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&
|
|
|
|
git-svn init --minimize-url -R argh -i e \
|
|
|
|
$svnrepo/mirror/argh/a/b/c/d/e &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git config svn.useSvmProps true &&
|
2007-02-17 11:53:07 +01:00
|
|
|
git-svn fetch --all
|
|
|
|
"
|
|
|
|
|
|
|
|
uuid=161ce429-a9dd-4828-af4a-52023f968c89
|
|
|
|
|
|
|
|
bar_url=http://mayonaise/svnrepo/bar
|
|
|
|
test_expect_success 'verify metadata for /bar' "
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@12 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar~1 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@11 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar~2 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@10 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar~3 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@9 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar~4 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@6 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/bar~5 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $bar_url@1 $uuid$'
|
|
|
|
"
|
|
|
|
|
|
|
|
e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
|
|
|
|
test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/e | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $e_url@1 $uuid$'
|
|
|
|
"
|
|
|
|
|
|
|
|
dir_url=http://mayonaise/svnrepo/dir
|
|
|
|
test_expect_success 'verify metadata for /dir' "
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/dir | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $dir_url@2 $uuid$' &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git cat-file commit refs/remotes/dir~1 | \
|
2007-02-17 11:53:07 +01:00
|
|
|
grep '^git-svn-id: $dir_url@1 $uuid$'
|
|
|
|
"
|
|
|
|
|
|
|
|
test_done
|