git-svn: make test for SVK mirror path import
[alt-git.git] / t / t9109-git-svn-svk-mirrorpaths.sh
blob0e0ba3df39fd6a766b004cfc5b321ea7e7387151
1 #!/bin/sh
3 # Copyright (c) 2006 Sam Vilian
6 test_description='git-svn on SVK mirror paths'
7 . ./lib-git-svn.sh
9 # ok, people who don't have SVK installed probably don't care about
10 # this test.
12 # we set up the repository manually, because even if SVK is installed
13 # it is difficult to use it in a way that is idempotent.
15 # we are not yet testing merge tickets..
17 uuid=b00bface-b1ff-c0ff-f0ff-b0bafe775e1e
18 url=https://really.slow.server.com/foobar
20 test_expect_success 'initialize repo' "
21 git config svn-remote.svn.useSvmProps true &&
23 echo '#!/bin/sh' > $rawsvnrepo/hooks/pre-revprop-change &&
24 echo 'exit 0' >> $rawsvnrepo/hooks/pre-revprop-change &&
25 chmod +x $rawsvnrepo/hooks/pre-revprop-change &&
27 mkdir import &&
28 cd import &&
29 mkdir local &&
30 echo hello > local/readme &&
31 svn import -m 'random local work' . $svnrepo &&
32 cd .. &&
34 svn co $svnrepo wc &&
35 cd wc &&
36 mkdir -p mirror/foobar &&
37 svn add mirror &&
38 svn ps svm:source $url mirror/foobar &&
39 svn ps svm:uuid $uuid mirror/foobar &&
40 svn ps svm:mirror / mirror/foobar &&
41 svn commit -m 'setup mirror/foobar as mirror of upstream' &&
42 svn ps -r 2 --revprop svm:headrev $uuid:0 $svnrepo &&
44 mkdir mirror/foobar/trunk
45 echo hello, world > mirror/foobar/trunk/readme &&
46 svn add mirror/foobar/trunk &&
47 svn commit -m 'first upstream revision' &&
48 svn ps -r 3 --revprop svm:headrev $uuid:1 $svnrepo &&
50 svn up &&
51 svn mkdir mirror/foobar/branches &&
52 svn cp mirror/foobar/trunk mirror/foobar/branches/silly &&
53 svn commit -m 'make branch for silliness' &&
54 svn ps -r 4 --revprop svm:headrev $uuid:2 $svnrepo &&
56 svn up &&
57 echo random untested feature >> mirror/foobar/trunk/readme &&
58 svn commit -m 'add a c00l feature to trunk' &&
59 svn ps -r 5 --revprop svm:headrev $uuid:3 $svnrepo &&
61 svn up &&
62 echo bug fix >> mirror/foobar/branches/silly/readme &&
63 svn commit -m 'fix a bug' &&
64 svn ps -r 6 --revprop svm:headrev $uuid:4 $svnrepo &&
66 svn mkdir mirror/foobar/tags &&
67 svn cp mirror/foobar/branches/silly mirror/foobar/tags/blah-1.0 &&
68 svn commit -m 'make a release' &&
69 svn ps -r 7 --revprop svm:headrev $uuid:5 $svnrepo &&
71 cd ..
74 test_expect_success 'multi-init an SVK mirror path' "
75 git-svn multi-init -T trunk -t tags -b branches $svnrepo/mirror/foobar
78 test_expect_success 'multi-fetch an SVK mirror path' "git-svn multi-fetch"
80 test_expect_success 'got tag history OK' "
81 test \`git-log --pretty=oneline remotes/tags/blah-1.0 | wc -l\` -eq 3
84 test_expect_success 're-wrote git-svn-id URL, revision and UUID' "
85 git cat-file commit refs/remotes/trunk | \
86 fgrep 'git-svn-id: $url/mirror/foobar/trunk@3 $uuid' &&
87 git cat-file commit refs/remotes/tags/blah-1.0 | \
88 fgrep 'git-svn-id: $url/mirror/foobar/tags/blah-1.0@5 $uuid'
89 git cat-file commit refs/remotes/silly | \
90 fgrep 'git-svn-id: $url/mirror/foobar/branches/silly@4 $uuid'
93 test_expect_success 're-wrote author e-mail domain UUID' "
94 test \`git log --pretty=fuller trunk | \
95 grep '<.*@.*>' | fgrep '@$uuid>' | wc -l\` -eq 4 &&
96 test \`git log --pretty=fuller remotes/silly | \
97 grep '<.*@.*>' | fgrep '@$uuid>' | wc -l\` -eq 6 &&
98 test \`git log --pretty=fuller remotes/tags/blah-1.0 | \
99 grep '<.*@.*>' | fgrep '@$uuid>' | wc -l\` -eq 6
102 test_debug 'gitk --all &'
104 test_done