##// 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
@@ -1,116 +1,135
1 1 #!/bin/sh
2 2
3 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 24 echo "[extensions]" >> $HGRCPATH
6 25 echo "convert = " >> $HGRCPATH
7 26
8 27 hg init a
9 28
10 29 echo a > a/a
11 30 mkdir -p a/d1/d2
12 31 echo b > a/d1/d2/b
13 32 echo % add
14 33 hg --cwd a ci -d '0 0' -A -m 'add a file'
15 34
16 35 echo a >> a/a
17 36 echo % modify
18 37 hg --cwd a ci -d '1 0' -m 'modify a file'
19 38 hg --cwd a tip -q
20 39
21 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 42 ls a a-hg-wc
24 43 cmp a/a a-hg-wc/a && echo same || echo different
25 44
26 45 hg --cwd a mv a b
27 46 echo % rename
28 47 hg --cwd a ci -d '2 0' -m 'rename a file'
29 48 hg --cwd a tip -q
30 49
31 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 52 ls a a-hg-wc
34 53
35 54 hg --cwd a cp b c
36 55 echo % copy
37 56 hg --cwd a ci -d '3 0' -m 'copy a file'
38 57 hg --cwd a tip -q
39 58
40 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 61 ls a a-hg-wc
43 62
44 63 hg --cwd a rm b
45 64 echo % remove
46 65 hg --cwd a ci -d '4 0' -m 'remove a file'
47 66 hg --cwd a tip -q
48 67
49 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 70 ls a a-hg-wc
52 71
53 72 chmod +x a/c
54 73 echo % executable
55 74 hg --cwd a ci -d '5 0' -m 'make a file executable'
56 75 hg --cwd a tip -q
57 76
58 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 79 test -x a-hg-wc/c && echo executable || echo not executable
61 80
62 81 echo % executable in new directory
63 82
64 83 rm -rf a a-hg a-hg-wc
65 84 hg init a
66 85
67 86 mkdir a/d1
68 87 echo a > a/d1/a
69 88 chmod +x a/d1/a
70 89 hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
71 90
72 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 93 test -x a-hg-wc/d1/a && echo executable || echo not executable
75 94
76 95 echo % copy to new directory
77 96
78 97 mkdir a/d2
79 98 hg --cwd a cp d1/a d2/a
80 99 hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
81 100
82 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 104 echo % branchy history
86 105
87 106 hg init b
88 107 echo base > b/b
89 108 hg --cwd b ci -d '0 0' -Ambase
90 109
91 110 echo left-1 >> b/b
92 111 echo left-1 > b/left-1
93 112 hg --cwd b ci -d '1 0' -Amleft-1
94 113
95 114 echo left-2 >> b/b
96 115 echo left-2 > b/left-2
97 116 hg --cwd b ci -d '2 0' -Amleft-2
98 117
99 118 hg --cwd b up 0
100 119
101 120 echo right-1 >> b/b
102 121 echo right-1 > b/right-1
103 122 hg --cwd b ci -d '3 0' -Amright-1
104 123
105 124 echo right-2 >> b/b
106 125 echo right-2 > b/right-2
107 126 hg --cwd b ci -d '4 0' -Amright-2
108 127
109 128 hg --cwd b up -C 2
110 129 hg --cwd b merge
111 130 hg --cwd b revert -r 2 b
112 131 hg --cwd b ci -d '5 0' -m 'merge'
113 132
114 133 hg convert -d svn b
115 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