##// END OF EJS Templates
Fix subversion tests with svn 1.5
Patrick Mezard -
r6851:6ec941b6 default
parent child Browse files
Show More
@@ -1,98 +1,98 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15
15
16 svnpath=`pwd | fix_path`
16 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that.
18 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null
19 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then
20 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
21 svnpath='/'$svnpath
22 fi
22 fi
23
23
24 echo % initial svn import
24 echo % initial svn import
25 mkdir projA
25 mkdir projA
26 cd projA
26 cd projA
27 mkdir trunk
27 mkdir trunk
28 mkdir branches
28 mkdir branches
29 mkdir tags
29 mkdir tags
30 cd ..
30 cd ..
31
31
32 svnurl=file://$svnpath/svn-repo/projA
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
33 svn import -m "init projA" projA $svnurl | fix_path
34
34
35 echo % update svn repository
35 echo % update svn repository
36 svn co $svnurl A | fix_path
36 svn co $svnurl A | fix_path
37 cd A
37 cd A
38 echo a > trunk/a
38 echo a > trunk/a
39 echo b > trunk/b
39 echo b > trunk/b
40 echo c > trunk/c
40 echo c > trunk/c
41 # Add a file within branches, used to confuse branch detection
41 # Add a file within branches, used to confuse branch detection
42 echo d > branches/notinbranch
42 echo d > branches/notinbranch
43 svn add trunk/a trunk/b trunk/c branches/notinbranch
43 svn add trunk/a trunk/b trunk/c branches/notinbranch
44 svn ci -m hello
44 svn ci -m hello
45
45
46 echo % branch to old
46 echo % branch to old
47 svn copy trunk branches/old
47 svn copy trunk branches/old
48 svn rm branches/old/c
48 svn rm branches/old/c
49 svn ci -m "branch trunk, remove c"
49 svn ci -m "branch trunk, remove c"
50 svn up
50 svn up
51
51
52 echo % update trunk
52 echo % update trunk
53 "$TESTDIR/svn-safe-append.py" a trunk/a
53 "$TESTDIR/svn-safe-append.py" a trunk/a
54 svn ci -m "change a"
54 svn ci -m "change a"
55
55
56 echo % update old branch
56 echo % update old branch
57 "$TESTDIR/svn-safe-append.py" b branches/old/b
57 "$TESTDIR/svn-safe-append.py" b branches/old/b
58 svn ci -m "change b"
58 svn ci -m "change b"
59
59
60 echo % create a cross-branch revision
60 echo % create a cross-branch revision
61 svn move -m "move b" trunk/b branches/old/c
61 svn move trunk/b branches/old/c
62 "$TESTDIR/svn-safe-append.py" c branches/old/c
62 "$TESTDIR/svn-safe-append.py" c branches/old/c
63 svn ci -m "move and update c"
63 svn ci -m "move and update c"
64
64
65 echo % update old branch again
65 echo % update old branch again
66 "$TESTDIR/svn-safe-append.py" b branches/old/b
66 "$TESTDIR/svn-safe-append.py" b branches/old/b
67 svn ci -m "change b again"
67 svn ci -m "change b again"
68
68
69 echo % move back and forth between branch of similar names
69 echo % move back and forth between branch of similar names
70 # This used to generate fake copy records
70 # This used to generate fake copy records
71 svn up
71 svn up
72 svn move branches/old branches/old2
72 svn move branches/old branches/old2
73 svn ci -m "move to old2"
73 svn ci -m "move to old2"
74 svn move branches/old2 branches/old
74 svn move branches/old2 branches/old
75 svn ci -m "move back to old"
75 svn ci -m "move back to old"
76
76
77 echo % update trunk again
77 echo % update trunk again
78 "$TESTDIR/svn-safe-append.py" a trunk/a
78 "$TESTDIR/svn-safe-append.py" a trunk/a
79 svn ci -m "last change to a"
79 svn ci -m "last change to a"
80 cd ..
80 cd ..
81
81
82 echo % convert trunk and branches
82 echo % convert trunk and branches
83 hg convert --datesort $svnurl A-hg
83 hg convert --datesort $svnurl A-hg
84
84
85 echo % branch again from a converted revision
85 echo % branch again from a converted revision
86 cd A
86 cd A
87 svn copy -r 1 $svnurl/trunk branches/old3
87 svn copy -r 1 $svnurl/trunk branches/old3
88 svn ci -m "branch trunk@1 into old3"
88 svn ci -m "branch trunk@1 into old3"
89 cd ..
89 cd ..
90
90
91 echo % convert again
91 echo % convert again
92 hg convert --datesort $svnurl A-hg
92 hg convert --datesort $svnurl A-hg
93
93
94 cd A-hg
94 cd A-hg
95 hg glog --template 'branch=#branches# #rev# #desc|firstline# files: #files#\n'
95 hg glog --template 'branch=#branches# #rev# #desc|firstline# files: #files#\n'
96 hg branches | sed 's/:.*/:/'
96 hg branches | sed 's/:.*/:/'
97 hg tags -q
97 hg tags -q
98 cd ..
98 cd ..
@@ -1,73 +1,82 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15
15
16 svnpath=`pwd | fix_path`
16 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that.
18 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null
19 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then
20 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
21 svnpath='/'$svnpath
22 fi
22 fi
23
23
24 echo % initial svn import
24 echo % initial svn import
25 mkdir projA
25 mkdir projA
26 cd projA
26 cd projA
27 mkdir trunk
27 mkdir trunk
28 echo a > trunk/a
28 echo a > trunk/a
29 mkdir trunk/d1
29 mkdir trunk/d1
30 mkdir trunk/d2
30 mkdir trunk/d2
31 echo b > trunk/d1/b
31 echo b > trunk/d1/b
32 echo c > trunk/d1/c
32 echo c > trunk/d1/c
33 echo d > trunk/d2/d
33 echo d > trunk/d2/d
34 cd ..
34 cd ..
35
35
36 svnurl=file://$svnpath/svn-repo/projA
36 svnurl=file://$svnpath/svn-repo/projA
37 svn import -m "init projA" projA $svnurl | fix_path
37 svn import -m "init projA" projA $svnurl | fix_path
38
38
39 # Build a module renaming chain which used to confuse the converter.
39 # Build a module renaming chain which used to confuse the converter.
40 echo % update svn repository
40 echo % update svn repository
41 svn co $svnurl A | fix_path
41 svn co $svnurl A | fix_path
42 cd A
42 cd A
43 "$TESTDIR/svn-safe-append.py" a trunk/a
43 "$TESTDIR/svn-safe-append.py" a trunk/a
44 "$TESTDIR/svn-safe-append.py" c trunk/d1/c
44 "$TESTDIR/svn-safe-append.py" c trunk/d1/c
45 svn ci -m commitbeforemove
45 svn ci -m commitbeforemove
46 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
46 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
47 svn up
47 svn up
48 mkdir subproject/trunk
48 mkdir subproject/trunk
49 svn add subproject/trunk
49 svn add subproject/trunk
50 svn ci -m createtrunk
50 svn ci -m createtrunk
51 mkdir subproject/branches
51 mkdir subproject/branches
52 svn add subproject/branches
52 svn add subproject/branches
53 svn ci -m createbranches
53 svn ci -m createbranches
54 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
54 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
55 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
55 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
56 svn up
56 svn up
57 "$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b
57 "$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b
58 svn rm subproject/trunk/d2
58 svn rm subproject/trunk/d2
59 svn ci -m "changeb and rm d2"
59 svn ci -m "changeb and rm d2"
60 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
60 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
61
62 if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then
63 # SVN >= 1.5 replaced the -r REV syntax with @REV
64 echo % copy a file from a past revision
65 svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast
66 echo % copy a directory from a past revision
67 svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast
68 else
61 echo % copy a file from a past revision
69 echo % copy a file from a past revision
62 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
70 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
63 echo % copy a directory from a past revision
71 echo % copy a directory from a past revision
64 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
72 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
73 fi
65 cd ..
74 cd ..
66
75
67 echo % convert trunk and branches
76 echo % convert trunk and branches
68 hg convert --datesort $svnurl/subproject A-hg
77 hg convert --datesort $svnurl/subproject A-hg
69
78
70 cd A-hg
79 cd A-hg
71 hg glog --template '#rev# #desc|firstline# files: #files#\n'
80 hg glog --template '#rev# #desc|firstline# files: #files#\n'
72 hg branches | sed 's/:.*/:/'
81 hg branches | sed 's/:.*/:/'
73 cd ..
82 cd ..
@@ -1,76 +1,76 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15
15
16 svnpath=`pwd | fix_path`
16 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that.
18 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null
19 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then
20 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
21 svnpath='/'$svnpath
22 fi
22 fi
23
23
24 echo % initial svn import
24 echo % initial svn import
25 mkdir projA
25 mkdir projA
26 cd projA
26 cd projA
27 mkdir trunk
27 mkdir trunk
28 mkdir branches
28 mkdir branches
29 mkdir tags
29 mkdir tags
30 mkdir unrelated
30 mkdir unrelated
31 cd ..
31 cd ..
32
32
33 svnurl=file://$svnpath/svn-repo/projA
33 svnurl=file://$svnpath/svn-repo/projA
34 svn import -m "init projA" projA $svnurl | fix_path
34 svn import -m "init projA" projA $svnurl | fix_path | sort
35
35
36 echo % update svn repository
36 echo % update svn repository
37 svn co $svnurl A | fix_path
37 svn co $svnurl A | fix_path
38 cd A
38 cd A
39 echo a > trunk/a
39 echo a > trunk/a
40 svn add trunk/a
40 svn add trunk/a
41 svn ci -m adda
41 svn ci -m adda
42 "$TESTDIR/svn-safe-append.py" a trunk/a
42 "$TESTDIR/svn-safe-append.py" a trunk/a
43 svn ci -m changea
43 svn ci -m changea
44 "$TESTDIR/svn-safe-append.py" a trunk/a
44 "$TESTDIR/svn-safe-append.py" a trunk/a
45 svn ci -m changea2
45 svn ci -m changea2
46 # Add an unrelated commit to test that tags are bound to the
46 # Add an unrelated commit to test that tags are bound to the
47 # correct "from" revision and not a dummy one
47 # correct "from" revision and not a dummy one
48 "$TESTDIR/svn-safe-append.py" a unrelated/dummy
48 "$TESTDIR/svn-safe-append.py" a unrelated/dummy
49 svn add unrelated/dummy
49 svn add unrelated/dummy
50 svn ci -m unrelatedchange
50 svn ci -m unrelatedchange
51 echo % tag current revision
51 echo % tag current revision
52 svn up
52 svn up
53 svn copy trunk tags/trunk.v1
53 svn copy trunk tags/trunk.v1
54 svn copy trunk tags/trunk.badtag
54 svn copy trunk tags/trunk.badtag
55 svn ci -m "tagging trunk.v1 trunk.badtag"
55 svn ci -m "tagging trunk.v1 trunk.badtag"
56 "$TESTDIR/svn-safe-append.py" a trunk/a
56 "$TESTDIR/svn-safe-append.py" a trunk/a
57 svn ci -m changea3
57 svn ci -m changea3
58 echo % fix the bad tag
58 echo % fix the bad tag
59 # trunk.badtag should not show in converted tags
59 # trunk.badtag should not show in converted tags
60 svn up
60 svn up
61 svn mv tags/trunk.badtag tags/trunk.goodtag
61 svn mv tags/trunk.badtag tags/trunk.goodtag
62 svn ci -m "fix trunk.badtag"
62 svn ci -m "fix trunk.badtag"
63 cd ..
63 cd ..
64
64
65 echo % convert
65 echo % convert
66 hg convert --datesort $svnurl A-hg
66 hg convert --datesort $svnurl A-hg
67
67
68 cd A-hg
68 cd A-hg
69 hg glog --template '#rev# #desc|firstline# tags: #tags#\n'
69 hg glog --template '#rev# #desc|firstline# tags: #tags#\n'
70 hg tags -q
70 hg tags -q
71 cd ..
71 cd ..
72
72
73 echo % convert without tags
73 echo % convert without tags
74 hg convert --datesort --config convert.svn.tags= $svnurl A-notags-hg
74 hg convert --datesort --config convert.svn.tags= $svnurl A-notags-hg
75 hg -R A-notags-hg tags -q
75 hg -R A-notags-hg tags -q
76
76
@@ -1,84 +1,84 b''
1 % initial svn import
1 % initial svn import
2
3 Adding projA/branches
4 Adding projA/tags
2 Adding projA/trunk
5 Adding projA/trunk
3 Adding projA/unrelated
6 Adding projA/unrelated
4 Adding projA/branches
5 Adding projA/tags
6
7 Committed revision 1.
7 Committed revision 1.
8 % update svn repository
8 % update svn repository
9 A A/trunk
9 A A/trunk
10 A A/unrelated
10 A A/unrelated
11 A A/branches
11 A A/branches
12 A A/tags
12 A A/tags
13 Checked out revision 1.
13 Checked out revision 1.
14 A trunk/a
14 A trunk/a
15 Adding trunk/a
15 Adding trunk/a
16 Transmitting file data .
16 Transmitting file data .
17 Committed revision 2.
17 Committed revision 2.
18 Sending trunk/a
18 Sending trunk/a
19 Transmitting file data .
19 Transmitting file data .
20 Committed revision 3.
20 Committed revision 3.
21 Sending trunk/a
21 Sending trunk/a
22 Transmitting file data .
22 Transmitting file data .
23 Committed revision 4.
23 Committed revision 4.
24 A unrelated/dummy
24 A unrelated/dummy
25 Adding unrelated/dummy
25 Adding unrelated/dummy
26 Transmitting file data .
26 Transmitting file data .
27 Committed revision 5.
27 Committed revision 5.
28 % tag current revision
28 % tag current revision
29 At revision 5.
29 At revision 5.
30 A tags/trunk.v1
30 A tags/trunk.v1
31 A tags/trunk.badtag
31 A tags/trunk.badtag
32 Adding tags/trunk.badtag
32 Adding tags/trunk.badtag
33 Adding tags/trunk.v1
33 Adding tags/trunk.v1
34
34
35 Committed revision 6.
35 Committed revision 6.
36 Sending trunk/a
36 Sending trunk/a
37 Transmitting file data .
37 Transmitting file data .
38 Committed revision 7.
38 Committed revision 7.
39 % fix the bad tag
39 % fix the bad tag
40 At revision 7.
40 At revision 7.
41 A tags/trunk.goodtag
41 A tags/trunk.goodtag
42 D tags/trunk.badtag/a
42 D tags/trunk.badtag/a
43 D tags/trunk.badtag
43 D tags/trunk.badtag
44 Deleting tags/trunk.badtag
44 Deleting tags/trunk.badtag
45 Adding tags/trunk.goodtag
45 Adding tags/trunk.goodtag
46
46
47 Committed revision 8.
47 Committed revision 8.
48 % convert
48 % convert
49 initializing destination A-hg repository
49 initializing destination A-hg repository
50 scanning source...
50 scanning source...
51 sorting...
51 sorting...
52 converting...
52 converting...
53 4 init projA
53 4 init projA
54 3 adda
54 3 adda
55 2 changea
55 2 changea
56 1 changea2
56 1 changea2
57 0 changea3
57 0 changea3
58 updating tags
58 updating tags
59 o 5 update tags tags: tip
59 o 5 update tags tags: tip
60 |
60 |
61 o 4 changea3 tags:
61 o 4 changea3 tags:
62 |
62 |
63 o 3 changea2 tags: trunk.v1 trunk.goodtag
63 o 3 changea2 tags: trunk.v1 trunk.goodtag
64 |
64 |
65 o 2 changea tags:
65 o 2 changea tags:
66 |
66 |
67 o 1 adda tags:
67 o 1 adda tags:
68 |
68 |
69 o 0 init projA tags:
69 o 0 init projA tags:
70
70
71 tip
71 tip
72 trunk.v1
72 trunk.v1
73 trunk.goodtag
73 trunk.goodtag
74 % convert without tags
74 % convert without tags
75 initializing destination A-notags-hg repository
75 initializing destination A-notags-hg repository
76 scanning source...
76 scanning source...
77 sorting...
77 sorting...
78 converting...
78 converting...
79 4 init projA
79 4 init projA
80 3 adda
80 3 adda
81 2 changea
81 2 changea
82 1 changea2
82 1 changea2
83 0 changea3
83 0 changea3
84 tip
84 tip
General Comments 0
You need to be logged in to leave comments. Login now