##// END OF EJS Templates
tests: fix test-flagprocessor.t flakiness...
Martin von Zweigbergk -
r33617:c6146dd1 stable
parent child Browse files
Show More
@@ -1,248 +1,250 b''
1 1 # Create server
2 2 $ hg init server
3 3 $ cd server
4 4 $ cat >> .hg/hgrc << EOF
5 5 > [extensions]
6 6 > extension=$TESTDIR/flagprocessorext.py
7 7 > EOF
8 8 $ cd ../
9 9
10 10 # Clone server and enable extensions
11 11 $ hg clone -q server client
12 12 $ cd client
13 13 $ cat >> .hg/hgrc << EOF
14 14 > [extensions]
15 15 > extension=$TESTDIR/flagprocessorext.py
16 16 > EOF
17 17
18 18 # Commit file that will trigger the noop extension
19 19 $ echo '[NOOP]' > noop
20 20 $ hg commit -Aqm "noop"
21 21
22 22 # Commit file that will trigger the base64 extension
23 23 $ echo '[BASE64]' > base64
24 24 $ hg commit -Aqm 'base64'
25 25
26 26 # Commit file that will trigger the gzip extension
27 27 $ echo '[GZIP]' > gzip
28 28 $ hg commit -Aqm 'gzip'
29 29
30 30 # Commit file that will trigger noop and base64
31 31 $ echo '[NOOP][BASE64]' > noop-base64
32 32 $ hg commit -Aqm 'noop+base64'
33 33
34 34 # Commit file that will trigger noop and gzip
35 35 $ echo '[NOOP][GZIP]' > noop-gzip
36 36 $ hg commit -Aqm 'noop+gzip'
37 37
38 38 # Commit file that will trigger base64 and gzip
39 39 $ echo '[BASE64][GZIP]' > base64-gzip
40 40 $ hg commit -Aqm 'base64+gzip'
41 41
42 42 # Commit file that will trigger base64, gzip and noop
43 43 $ echo '[BASE64][GZIP][NOOP]' > base64-gzip-noop
44 44 $ hg commit -Aqm 'base64+gzip+noop'
45 45
46 46 # TEST: ensure the revision data is consistent
47 47 $ hg cat noop
48 48 [NOOP]
49 49 $ hg debugdata noop 0
50 50 [NOOP]
51 51
52 52 $ hg cat -r . base64
53 53 [BASE64]
54 54 $ hg debugdata base64 0
55 55 W0JBU0U2NF0K (no-eol)
56 56
57 57 $ hg cat -r . gzip
58 58 [GZIP]
59 59 $ hg debugdata gzip 0
60 60 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc)
61 61
62 62 $ hg cat -r . noop-base64
63 63 [NOOP][BASE64]
64 64 $ hg debugdata noop-base64 0
65 65 W05PT1BdW0JBU0U2NF0K (no-eol)
66 66
67 67 $ hg cat -r . noop-gzip
68 68 [NOOP][GZIP]
69 69 $ hg debugdata noop-gzip 0
70 70 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc)
71 71
72 72 $ hg cat -r . base64-gzip
73 73 [BASE64][GZIP]
74 74 $ hg debugdata base64-gzip 0
75 75 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol)
76 76
77 77 $ hg cat -r . base64-gzip-noop
78 78 [BASE64][GZIP][NOOP]
79 79 $ hg debugdata base64-gzip-noop 0
80 80 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol)
81 81
82 82 # Push to the server
83 83 $ hg push
84 84 pushing to $TESTTMP/server (glob)
85 85 searching for changes
86 86 adding changesets
87 87 adding manifests
88 88 adding file changes
89 89 added 7 changesets with 7 changes to 7 files
90 90
91 91 # Initialize new client (not cloning) and setup extension
92 92 $ cd ..
93 93 $ hg init client2
94 94 $ cd client2
95 95 $ cat >> .hg/hgrc << EOF
96 96 > [paths]
97 97 > default = $TESTTMP/server
98 98 > [extensions]
99 99 > extension=$TESTDIR/flagprocessorext.py
100 100 > EOF
101 101
102 102 # Pull from server and update to latest revision
103 103 $ hg pull default
104 104 pulling from $TESTTMP/server (glob)
105 105 requesting all changes
106 106 adding changesets
107 107 adding manifests
108 108 adding file changes
109 109 added 7 changesets with 7 changes to 7 files
110 110 (run 'hg update' to get a working copy)
111 111 $ hg update
112 112 7 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 113
114 114 # TEST: ensure the revision data is consistent
115 115 $ hg cat noop
116 116 [NOOP]
117 117 $ hg debugdata noop 0
118 118 [NOOP]
119 119
120 120 $ hg cat -r . base64
121 121 [BASE64]
122 122 $ hg debugdata base64 0
123 123 W0JBU0U2NF0K (no-eol)
124 124
125 125 $ hg cat -r . gzip
126 126 [GZIP]
127 127 $ hg debugdata gzip 0
128 128 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc)
129 129
130 130 $ hg cat -r . noop-base64
131 131 [NOOP][BASE64]
132 132 $ hg debugdata noop-base64 0
133 133 W05PT1BdW0JBU0U2NF0K (no-eol)
134 134
135 135 $ hg cat -r . noop-gzip
136 136 [NOOP][GZIP]
137 137 $ hg debugdata noop-gzip 0
138 138 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc)
139 139
140 140 $ hg cat -r . base64-gzip
141 141 [BASE64][GZIP]
142 142 $ hg debugdata base64-gzip 0
143 143 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol)
144 144
145 145 $ hg cat -r . base64-gzip-noop
146 146 [BASE64][GZIP][NOOP]
147 147 $ hg debugdata base64-gzip-noop 0
148 148 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol)
149 149
150 150 # TEST: ensure a missing processor is handled
151 151 $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop
152 152 $ hg commit -Aqm 'fail+base64+gzip+noop'
153 153 abort: missing processor for flag '0x1'!
154 154 [255]
155 155 $ hg forget fail-base64-gzip-noop
156 156 $ rm fail-base64-gzip-noop
157 157
158 158 # TEST: ensure we cannot register several flag processors on the same flag
159 159 $ cat >> .hg/hgrc << EOF
160 160 > [extensions]
161 161 > extension=$TESTDIR/flagprocessorext.py
162 162 > duplicate=$TESTDIR/flagprocessorext.py
163 163 > EOF
164 $ echo 'this should fail' > file
165 $ hg commit -Aqm 'add file'
164 $ hg debugrebuilddirstate
166 165 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
166 $ hg st 2>&1 | egrep 'cannot register multiple processors|flagprocessorext'
167 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
168 File "*/tests/flagprocessorext.py", line *, in b64decode (glob)
167 169
168 170 $ cd ..
169 171
170 172 # TEST: bundle repo
171 173 $ hg init bundletest
172 174 $ cd bundletest
173 175
174 176 $ cat >> .hg/hgrc << EOF
175 177 > [extensions]
176 178 > flagprocessor=$TESTDIR/flagprocessorext.py
177 179 > EOF
178 180
179 181 $ for i in 0 single two three 4; do
180 182 > echo '[BASE64]a-bit-longer-'$i > base64
181 183 > hg commit -m base64-$i -A base64
182 184 > done
183 185
184 186 $ hg update 2 -q
185 187 $ echo '[BASE64]a-bit-longer-branching' > base64
186 188 $ hg commit -q -m branching
187 189
188 190 $ hg bundle --base 1 bundle.hg
189 191 4 changesets found
190 192 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
191 193 $ hg -R bundle.hg log --stat -T '{rev} {desc}\n' base64
192 194 5 branching
193 195 base64 | 2 +-
194 196 1 files changed, 1 insertions(+), 1 deletions(-)
195 197
196 198 4 base64-4
197 199 base64 | 2 +-
198 200 1 files changed, 1 insertions(+), 1 deletions(-)
199 201
200 202 3 base64-three
201 203 base64 | 2 +-
202 204 1 files changed, 1 insertions(+), 1 deletions(-)
203 205
204 206 2 base64-two
205 207 base64 | 2 +-
206 208 1 files changed, 1 insertions(+), 1 deletions(-)
207 209
208 210 1 base64-single
209 211 base64 | 2 +-
210 212 1 files changed, 1 insertions(+), 1 deletions(-)
211 213
212 214 0 base64-0
213 215 base64 | 1 +
214 216 1 files changed, 1 insertions(+), 0 deletions(-)
215 217
216 218
217 219 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
218 220 $ hg -R bundle-again.hg log --stat -T '{rev} {desc}\n' base64
219 221 5 branching
220 222 base64 | 2 +-
221 223 1 files changed, 1 insertions(+), 1 deletions(-)
222 224
223 225 4 base64-4
224 226 base64 | 2 +-
225 227 1 files changed, 1 insertions(+), 1 deletions(-)
226 228
227 229 3 base64-three
228 230 base64 | 2 +-
229 231 1 files changed, 1 insertions(+), 1 deletions(-)
230 232
231 233 2 base64-two
232 234 base64 | 2 +-
233 235 1 files changed, 1 insertions(+), 1 deletions(-)
234 236
235 237 1 base64-single
236 238 base64 | 2 +-
237 239 1 files changed, 1 insertions(+), 1 deletions(-)
238 240
239 241 0 base64-0
240 242 base64 | 1 +
241 243 1 files changed, 1 insertions(+), 0 deletions(-)
242 244
243 245 $ rm bundle.hg bundle-again.hg
244 246
245 247 # TEST: hg status
246 248
247 249 $ hg status
248 250 $ hg diff
General Comments 0
You need to be logged in to leave comments. Login now