##// END OF EJS Templates
test-convert-svn-sink: wrap repetitive svn checks in a function
Patrick Mezard -
r5808:80e40ef3 default
parent child Browse files
Show More
@@ -2,6 +2,25 b''
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fixpath()
6 {
7 tr '\\' /
8 }
9
10 svnupanddisplay()
11 {
12 (
13 cd $1;
14 svn up;
15 svn st -v | fixpath
16 limit=''
17 if [ $2 -gt 0 ]; then
18 limit="--limit=$2"
19 fi
20 svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,'
21 )
22 }
23
5 echo "[extensions]" >> $HGRCPATH
24 echo "[extensions]" >> $HGRCPATH
6 echo "convert = " >> $HGRCPATH
25 echo "convert = " >> $HGRCPATH
7
26
@@ -19,7 +38,7 b" hg --cwd a ci -d '1 0' -m 'modify a file"
19 hg --cwd a tip -q
38 hg --cwd a tip -q
20
39
21 hg convert -d svn a
40 hg convert -d svn a
22 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=2 | sed 's,<date>.*,<date/>,')
41 svnupanddisplay a-hg-wc 2
23 ls a a-hg-wc
42 ls a a-hg-wc
24 cmp a/a a-hg-wc/a && echo same || echo different
43 cmp a/a a-hg-wc/a && echo same || echo different
25
44
@@ -29,7 +48,7 b" hg --cwd a ci -d '2 0' -m 'rename a file"
29 hg --cwd a tip -q
48 hg --cwd a tip -q
30
49
31 hg convert -d svn a
50 hg convert -d svn a
32 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
51 svnupanddisplay a-hg-wc 1
33 ls a a-hg-wc
52 ls a a-hg-wc
34
53
35 hg --cwd a cp b c
54 hg --cwd a cp b c
@@ -38,7 +57,7 b" hg --cwd a ci -d '3 0' -m 'copy a file'"
38 hg --cwd a tip -q
57 hg --cwd a tip -q
39
58
40 hg convert -d svn a
59 hg convert -d svn a
41 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
60 svnupanddisplay a-hg-wc 1
42 ls a a-hg-wc
61 ls a a-hg-wc
43
62
44 hg --cwd a rm b
63 hg --cwd a rm b
@@ -47,7 +66,7 b" hg --cwd a ci -d '4 0' -m 'remove a file"
47 hg --cwd a tip -q
66 hg --cwd a tip -q
48
67
49 hg convert -d svn a
68 hg convert -d svn a
50 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
69 svnupanddisplay a-hg-wc 1
51 ls a a-hg-wc
70 ls a a-hg-wc
52
71
53 chmod +x a/c
72 chmod +x a/c
@@ -56,7 +75,7 b" hg --cwd a ci -d '5 0' -m 'make a file e"
56 hg --cwd a tip -q
75 hg --cwd a tip -q
57
76
58 hg convert -d svn a
77 hg convert -d svn a
59 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
78 svnupanddisplay a-hg-wc 1
60 test -x a-hg-wc/c && echo executable || echo not executable
79 test -x a-hg-wc/c && echo executable || echo not executable
61
80
62 echo % executable in new directory
81 echo % executable in new directory
@@ -70,7 +89,7 b' chmod +x a/d1/a'
70 hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
89 hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
71
90
72 hg convert -d svn a
91 hg convert -d svn a
73 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
92 svnupanddisplay a-hg-wc 1
74 test -x a-hg-wc/d1/a && echo executable || echo not executable
93 test -x a-hg-wc/d1/a && echo executable || echo not executable
75
94
76 echo % copy to new directory
95 echo % copy to new directory
@@ -80,7 +99,7 b' hg --cwd a cp d1/a d2/a'
80 hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
99 hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
81
100
82 hg convert -d svn a
101 hg convert -d svn a
83 (cd a-hg-wc; svn up; svn st -v; svn log --xml -v --limit=1 | sed 's,<date>.*,<date/>,')
102 svnupanddisplay a-hg-wc 1
84
103
85 echo % branchy history
104 echo % branchy history
86
105
@@ -113,4 +132,4 b" hg --cwd b ci -d '5 0' -m 'merge'"
113
132
114 hg convert -d svn b
133 hg convert -d svn b
115 echo % expect 4 changes
134 echo % expect 4 changes
116 (cd b-hg-wc; svn up; svn st -v; svn log --xml -v | sed 's,<date>.*,<date/>,')
135 svnupanddisplay b-hg-wc 0
General Comments 0
You need to be logged in to leave comments. Login now