comparison tests/test-convert-svn-branches @ 5874:866aa7ae2612

Test subversion branches conversion
author Patrick Mezard <pmezard@gmail.com>
date Thu, 17 Jan 2008 23:46:56 +0100
parents
children c1b47c0fd2b6
comparison
equal deleted inserted replaced
5873:ecb4eb0cbff2 5874:866aa7ae2612
1 #!/bin/sh
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
5 fix_path()
6 {
7 tr '\\' /
8 }
9
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
14 svnadmin create svn-repo
15
16 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 fi
23
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir branches
29 mkdir tags
30 cd ..
31
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
34
35 echo % update svn repository
36 svn co $svnurl A | fix_path
37 cd A
38 echo hello > trunk/letter.txt
39 echo hey > trunk/letter2.txt
40 echo ho > trunk/letter3.txt
41 svn add trunk/letter.txt trunk/letter2.txt trunk/letter3.txt
42 svn ci -m hello
43
44 echo % branch to old letters
45 svn copy trunk branches/old
46 svn rm branches/old/letter3.txt
47 svn ci -m "branch trunk, remove letter3"
48 svn up
49
50 echo % update trunk
51 echo "what can I say ?" >> trunk/letter.txt
52 svn ci -m "change letter"
53
54 echo % update old branch
55 echo "what's up ?" >> branches/old/letter2.txt
56 svn ci -m "change letter2"
57
58 echo % create a cross-branch revision
59 svn move -m "move letter2" trunk/letter2.txt \
60 branches/old/letter3.txt
61 echo "I am fine" >> branches/old/letter3.txt
62 svn ci -m "move and update letter3.txt"
63
64 echo % update old branch again
65 echo "bye" >> branches/old/letter2.txt
66 svn ci -m "change letter2 again"
67
68 echo % update trunk again
69 echo "how are you ?" >> trunk/letter.txt
70 svn ci -m "last change to letter"
71 cd ..
72
73 echo % convert trunk and branches
74 hg convert --datesort $svnurl A-hg
75
76 echo % branch again from a converted revision
77 cd A
78 svn copy -r 1 $svnurl/trunk branches/old2
79 svn ci -m "branch trunk@1 into old2"
80 cd ..
81
82 echo % convert again
83 hg convert --datesort $svnurl A-hg
84
85 cd A-hg
86 hg glog --template '#rev# #desc|firstline# files: #files#\n'
87 hg branches | sed 's/:.*/:/'
88 hg tags -q
89 cd ..