aboutsummaryrefslogtreecommitdiff
path: root/t/t9104-git-svn-follow-parent.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-01-28 04:59:05 -0800
committerEric Wong <normalperson@yhbt.net>2007-02-23 00:57:10 -0800
commit2b27f6c8847ebee631e7ad17ac9986e461d7674b (patch)
treec927a6f524bf5ee52e1f379bd80c51df6cae1469 /t/t9104-git-svn-follow-parent.sh
parent2fa6a23efb200cea814add88ce1d1d193ba83860 (diff)
downloadgit-2b27f6c8847ebee631e7ad17ac9986e461d7674b.tar.gz
git-2b27f6c8847ebee631e7ad17ac9986e461d7674b.tar.xz
git-svn: correctly handle do_{switch,update} in deep directories
The do_update or do_switch functions in SVN only allow for a single path component; so 'path/to/deep/dir' would be interpreted as 'path'. SVN 1.4.x has a reparent function that can let us change the session to use a higher-level root of the repository, so we can use that for do_switch (which still doesn't seem to work in SVN 1.4.3 (a fix was attempted, but they missed the rest of the typemap changes needed in trunk...)). On the do_update side, we can use set_path on higher level directories and set them to a newer revision so they don't get updated. We can't do this with do_switch, either, because the relative path we're tracking can change (directory moving into a child of itself). Because of these changes, we need to double check that our Fetch editor is correctly performing stripping on any prefixed paths from update, otherwise we'll just die() because that would be a bug. Added a test case which helped me notice and fix problems with do_switch, too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 't/t9104-git-svn-follow-parent.sh')
-rwxr-xr-xt/t9104-git-svn-follow-parent.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index bfb718886..6d243f848 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -101,6 +101,37 @@ test_expect_success 'follow deleted directory' "
test -z \"\`git ls-tree -z refs/remotes/glob\`\"
"
+# ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)
+# in trunk/subversion/bindings/swig/perl
+test_expect_success '' "
+ mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
+ for i in a b c ; do \
+ echo \$i > import/trunk/subversion/bindings/swig/perl/\$i.pm &&
+ echo _\$i > import/trunk/subversion/bindings/swig/perl/t/\$i.t; \
+ done &&
+ echo 'bad delete test' > \
+ import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
+ echo 'bad delete test 2' > \
+ import/trunk/subversion/bindings/swig/perl/another-larger &&
+ cd import &&
+ svn import -m 'r9270 test' . $svnrepo/r9270 &&
+ cd .. &&
+ svn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&
+ cd r9270 &&
+ svn mkdir native &&
+ svn mv t native/t &&
+ for i in a b c; do svn mv \$i.pm native/\$i.pm; done &&
+ echo z >> native/t/c.t &&
+ svn commit -m 'reorg test' &&
+ cd .. &&
+ git-svn init -i r9270-t \
+ $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
+ git-svn fetch -i r9270-t --follow-parent &&
+ test \`git rev-list r9270-t | wc -l\` -eq 2 &&
+ test \"\`git ls-tree --name-only r9270-t~1\`\" = \
+ \"\`git ls-tree --name-only r9270-t\`\"
+ "
+
test_debug 'gitk --all &'
test_done