##// END OF EJS Templates
py3: add Python 3 output for test-flagprocessor.t...
Gregory Szorc -
r41583:a4392b5c default draft
parent child Browse files
Show More
@@ -1,302 +1,304 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
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 Ensure the data got to the server OK
92 92
93 93 $ cd ../server
94 94 $ hg cat -r 6e48f4215d24 noop
95 95 [NOOP]
96 96 $ hg debugdata noop 0
97 97 [NOOP]
98 98
99 99 $ hg cat -r 6e48f4215d24 base64
100 100 [BASE64]
101 101 $ hg debugdata base64 0
102 102 W0JBU0U2NF0K (no-eol)
103 103
104 104 $ hg cat -r 6e48f4215d24 gzip
105 105 [GZIP]
106 106 $ hg debugdata gzip 0
107 107 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc)
108 108
109 109 $ hg cat -r 6e48f4215d24 noop-base64
110 110 [NOOP][BASE64]
111 111 $ hg debugdata noop-base64 0
112 112 W05PT1BdW0JBU0U2NF0K (no-eol)
113 113
114 114 $ hg cat -r 6e48f4215d24 noop-gzip
115 115 [NOOP][GZIP]
116 116 $ hg debugdata noop-gzip 0
117 117 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc)
118 118
119 119 $ hg cat -r 6e48f4215d24 base64-gzip
120 120 [BASE64][GZIP]
121 121 $ hg debugdata base64-gzip 0
122 122 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol)
123 123
124 124 $ hg cat -r 6e48f4215d24 base64-gzip-noop
125 125 [BASE64][GZIP][NOOP]
126 126 $ hg debugdata base64-gzip-noop 0
127 127 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol)
128 128
129 129 # Initialize new client (not cloning) and setup extension
130 130 $ cd ..
131 131 $ hg init client2
132 132 $ cd client2
133 133 $ cat >> .hg/hgrc << EOF
134 134 > [paths]
135 135 > default = $TESTTMP/server
136 136 > [extensions]
137 137 > extension=$TESTDIR/flagprocessorext.py
138 138 > EOF
139 139
140 140 # Pull from server and update to latest revision
141 141 $ hg pull default
142 142 pulling from $TESTTMP/server
143 143 requesting all changes
144 144 adding changesets
145 145 adding manifests
146 146 adding file changes
147 147 added 7 changesets with 7 changes to 7 files
148 148 new changesets 07b1b9442c5b:6e48f4215d24
149 149 (run 'hg update' to get a working copy)
150 150 $ hg update
151 151 7 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 152
153 153 # TEST: ensure the revision data is consistent
154 154 $ hg cat noop
155 155 [NOOP]
156 156 $ hg debugdata noop 0
157 157 [NOOP]
158 158
159 159 $ hg cat -r . base64
160 160 [BASE64]
161 161 $ hg debugdata base64 0
162 162 W0JBU0U2NF0K (no-eol)
163 163
164 164 $ hg cat -r . gzip
165 165 [GZIP]
166 166 $ hg debugdata gzip 0
167 167 x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc)
168 168
169 169 $ hg cat -r . noop-base64
170 170 [NOOP][BASE64]
171 171 $ hg debugdata noop-base64 0
172 172 W05PT1BdW0JBU0U2NF0K (no-eol)
173 173
174 174 $ hg cat -r . noop-gzip
175 175 [NOOP][GZIP]
176 176 $ hg debugdata noop-gzip 0
177 177 x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc)
178 178
179 179 $ hg cat -r . base64-gzip
180 180 [BASE64][GZIP]
181 181 $ hg debugdata base64-gzip 0
182 182 eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol)
183 183
184 184 $ hg cat -r . base64-gzip-noop
185 185 [BASE64][GZIP][NOOP]
186 186 $ hg debugdata base64-gzip-noop 0
187 187 eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol)
188 188
189 189 # TEST: ensure a missing processor is handled
190 190 $ echo '[FAIL][BASE64][GZIP][NOOP]' > fail-base64-gzip-noop
191 191 $ hg commit -Aqm 'fail+base64+gzip+noop'
192 192 abort: missing processor for flag '0x1'!
193 193 [255]
194 194 $ rm fail-base64-gzip-noop
195 195
196 196 # TEST: ensure we cannot register several flag processors on the same flag
197 197 $ cat >> .hg/hgrc << EOF
198 198 > [extensions]
199 199 > extension=$TESTDIR/flagprocessorext.py
200 200 > duplicate=$TESTDIR/flagprocessorext.py
201 201 > EOF
202 202 $ hg debugrebuilddirstate
203 203 Traceback (most recent call last):
204 204 File "*/mercurial/extensions.py", line *, in _runextsetup (glob)
205 205 extsetup(ui)
206 206 File "*/tests/flagprocessorext.py", line *, in extsetup (glob)
207 207 validatehash,
208 208 File "*/mercurial/revlog.py", line *, in addflagprocessor (glob)
209 209 _insertflagprocessor(flag, processor, _flagprocessors)
210 210 File "*/mercurial/revlog.py", line *, in _insertflagprocessor (glob)
211 211 raise error.Abort(msg)
212 Abort: cannot register multiple processors on flag '0x8'.
212 mercurial.error.Abort: b"cannot register multiple processors on flag '0x8'." (py3 !)
213 Abort: cannot register multiple processors on flag '0x8'. (no-py3 !)
213 214 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
214 215 $ hg st 2>&1 | egrep 'cannot register multiple processors|flagprocessorext'
215 216 File "*/tests/flagprocessorext.py", line *, in extsetup (glob)
216 Abort: cannot register multiple processors on flag '0x8'.
217 mercurial.error.Abort: b"cannot register multiple processors on flag '0x8'." (py3 !)
218 Abort: cannot register multiple processors on flag '0x8'. (no-py3 !)
217 219 *** failed to set up extension duplicate: cannot register multiple processors on flag '0x8'.
218 220 File "*/tests/flagprocessorext.py", line *, in b64decode (glob)
219 221
220 222 $ cd ..
221 223
222 224 # TEST: bundle repo
223 225 $ hg init bundletest
224 226 $ cd bundletest
225 227
226 228 $ cat >> .hg/hgrc << EOF
227 229 > [extensions]
228 230 > flagprocessor=$TESTDIR/flagprocessorext.py
229 231 > EOF
230 232
231 233 $ for i in 0 single two three 4; do
232 234 > echo '[BASE64]a-bit-longer-'$i > base64
233 235 > hg commit -m base64-$i -A base64
234 236 > done
235 237
236 238 $ hg update 2 -q
237 239 $ echo '[BASE64]a-bit-longer-branching' > base64
238 240 $ hg commit -q -m branching
239 241
240 242 #if repobundlerepo
241 243 $ hg bundle --base 1 bundle.hg
242 244 4 changesets found
243 245 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
244 246 $ hg -R bundle.hg log --stat -T '{rev} {desc}\n' base64
245 247 5 branching
246 248 base64 | 2 +-
247 249 1 files changed, 1 insertions(+), 1 deletions(-)
248 250
249 251 4 base64-4
250 252 base64 | 2 +-
251 253 1 files changed, 1 insertions(+), 1 deletions(-)
252 254
253 255 3 base64-three
254 256 base64 | 2 +-
255 257 1 files changed, 1 insertions(+), 1 deletions(-)
256 258
257 259 2 base64-two
258 260 base64 | 2 +-
259 261 1 files changed, 1 insertions(+), 1 deletions(-)
260 262
261 263 1 base64-single
262 264 base64 | 2 +-
263 265 1 files changed, 1 insertions(+), 1 deletions(-)
264 266
265 267 0 base64-0
266 268 base64 | 1 +
267 269 1 files changed, 1 insertions(+), 0 deletions(-)
268 270
269 271
270 272 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
271 273 $ hg -R bundle-again.hg log --stat -T '{rev} {desc}\n' base64
272 274 5 branching
273 275 base64 | 2 +-
274 276 1 files changed, 1 insertions(+), 1 deletions(-)
275 277
276 278 4 base64-4
277 279 base64 | 2 +-
278 280 1 files changed, 1 insertions(+), 1 deletions(-)
279 281
280 282 3 base64-three
281 283 base64 | 2 +-
282 284 1 files changed, 1 insertions(+), 1 deletions(-)
283 285
284 286 2 base64-two
285 287 base64 | 2 +-
286 288 1 files changed, 1 insertions(+), 1 deletions(-)
287 289
288 290 1 base64-single
289 291 base64 | 2 +-
290 292 1 files changed, 1 insertions(+), 1 deletions(-)
291 293
292 294 0 base64-0
293 295 base64 | 1 +
294 296 1 files changed, 1 insertions(+), 0 deletions(-)
295 297
296 298 $ rm bundle.hg bundle-again.hg
297 299 #endif
298 300
299 301 # TEST: hg status
300 302
301 303 $ hg status
302 304 $ hg diff
General Comments 0
You need to be logged in to leave comments. Login now