##// END OF EJS Templates
py3: use print_function in test-hybridencode.py
Robert Stanca -
r28750:2b0d7be9 default
parent child Browse files
Show More
@@ -57,7 +57,6 b''
57 tests/test-demandimport.py requires print_function
57 tests/test-demandimport.py requires print_function
58 tests/test-doctest.py not using absolute_import
58 tests/test-doctest.py not using absolute_import
59 tests/test-hgwebdir-paths.py not using absolute_import
59 tests/test-hgwebdir-paths.py not using absolute_import
60 tests/test-hybridencode.py requires print_function
61 tests/test-lrucachedict.py not using absolute_import
60 tests/test-lrucachedict.py not using absolute_import
62 tests/test-lrucachedict.py requires print_function
61 tests/test-lrucachedict.py requires print_function
63 tests/test-manifest.py not using absolute_import
62 tests/test-manifest.py not using absolute_import
@@ -237,7 +236,6 b''
237 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
236 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
238 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
237 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
239 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
238 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
240 tests/test-hybridencode.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
241 tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
239 tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
242 tests/test-minirst.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
240 tests/test-minirst.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
243 tests/test-parseindex*.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
241 tests/test-parseindex*.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
@@ -1,38 +1,38 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import, print_function
2 from mercurial import (
2 from mercurial import (
3 store,
3 store,
4 )
4 )
5
5
6 def show(s):
6 def show(s):
7 # show test input
7 # show test input
8 print "A = '%s'" % s.encode("string_escape")
8 print("A = '%s'" % s.encode("string_escape"))
9
9
10 # show the result of the C implementation, if available
10 # show the result of the C implementation, if available
11 h = store._pathencode(s)
11 h = store._pathencode(s)
12 print "B = '%s'" % h.encode("string_escape")
12 print("B = '%s'" % h.encode("string_escape"))
13
13
14 # compare it with reference implementation in Python
14 # compare it with reference implementation in Python
15 r = store._hybridencode(s, True)
15 r = store._hybridencode(s, True)
16 if h != r:
16 if h != r:
17 print "R = '%s'" % r.encode("string_escape")
17 print("R = '%s'" % r.encode("string_escape"))
18 print
18 print()
19
19
20 show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;=[]^`{}")
20 show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;=[]^`{}")
21
21
22 print "uppercase char X is encoded as _x"
22 print("uppercase char X is encoded as _x")
23 show("data/ABCDEFGHIJKLMNOPQRSTUVWXYZ")
23 show("data/ABCDEFGHIJKLMNOPQRSTUVWXYZ")
24
24
25 print "underbar is doubled"
25 print("underbar is doubled")
26 show("data/_")
26 show("data/_")
27
27
28 print "tilde is character-encoded"
28 print("tilde is character-encoded")
29 show("data/~")
29 show("data/~")
30
30
31 print "characters in ASCII code range 1..31"
31 print("characters in ASCII code range 1..31")
32 show('data/\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'
32 show('data/\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'
33 '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f')
33 '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f')
34
34
35 print "characters in ASCII code range 126..255"
35 print("characters in ASCII code range 126..255")
36 show('data/\x7e\x7f'
36 show('data/\x7e\x7f'
37 '\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f'
37 '\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f'
38 '\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f')
38 '\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f')
@@ -43,18 +43,18 b" show('data/\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\"
43 show('data/\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef'
43 show('data/\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef'
44 '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
44 '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
45
45
46 print "Windows reserved characters"
46 print("Windows reserved characters")
47 show('data/less <, greater >, colon :, double-quote ", backslash \\'
47 show('data/less <, greater >, colon :, double-quote ", backslash \\'
48 ', pipe |, question-mark ?, asterisk *')
48 ', pipe |, question-mark ?, asterisk *')
49
49
50 print "encoding directories ending in .hg, .i or .d with '.hg' suffix"
50 print("encoding directories ending in .hg, .i or .d with '.hg' suffix")
51 show('data/x.h.i/x.hg/x.i/x.d/foo')
51 show('data/x.h.i/x.hg/x.i/x.d/foo')
52 show('data/a.hg/a.i/a.d/foo')
52 show('data/a.hg/a.i/a.d/foo')
53 show('data/au.hg/au.i/au.d/foo')
53 show('data/au.hg/au.i/au.d/foo')
54 show('data/aux.hg/aux.i/aux.d/foo')
54 show('data/aux.hg/aux.i/aux.d/foo')
55 show('data/auxy.hg/auxy.i/auxy.d/foo')
55 show('data/auxy.hg/auxy.i/auxy.d/foo')
56
56
57 print "but these are not encoded on *filenames*"
57 print("but these are not encoded on *filenames*")
58 show('data/foo/x.hg')
58 show('data/foo/x.hg')
59 show('data/foo/x.i')
59 show('data/foo/x.i')
60 show('data/foo/x.d')
60 show('data/foo/x.d')
@@ -71,7 +71,7 b" show('data/foo/auxy.hg')"
71 show('data/foo/auxy.i')
71 show('data/foo/auxy.i')
72 show('data/foo/auxy.d')
72 show('data/foo/auxy.d')
73
73
74 print "plain .hg, .i and .d directories have the leading dot encoded"
74 print("plain .hg, .i and .d directories have the leading dot encoded")
75 show('data/.hg/.i/.d/foo')
75 show('data/.hg/.i/.d/foo')
76
76
77 show('data/aux.bla/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c.i')
77 show('data/aux.bla/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c.i')
@@ -129,22 +129,22 b" show('data/com9./com9y./com9.')"
129
129
130 show('data/a /au /aux /auxy /aux ')
130 show('data/a /au /aux /auxy /aux ')
131
131
132 print "largest unhashed path"
132 print("largest unhashed path")
133 show('data/123456789-123456789-123456789-123456789-123456789-'
133 show('data/123456789-123456789-123456789-123456789-123456789-'
134 'unhashed--xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
134 'unhashed--xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
135 '123456789-12345')
135 '123456789-12345')
136
136
137 print "shortest hashed path"
137 print("shortest hashed path")
138 show('data/123456789-123456789-123456789-123456789-123456789-'
138 show('data/123456789-123456789-123456789-123456789-123456789-'
139 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
139 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
140 '123456789-123456')
140 '123456789-123456')
141
141
142 print "changing one char in part that's hashed away produces a different hash"
142 print("changing one char in part that's hashed away produces a different hash")
143 show('data/123456789-123456789-123456789-123456789-123456789-'
143 show('data/123456789-123456789-123456789-123456789-123456789-'
144 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxy-'
144 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxy-'
145 '123456789-123456')
145 '123456789-123456')
146
146
147 print "uppercase hitting length limit due to encoding"
147 print("uppercase hitting length limit due to encoding")
148 show('data/A23456789-123456789-123456789-123456789-123456789-'
148 show('data/A23456789-123456789-123456789-123456789-123456789-'
149 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
149 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
150 '123456789-12345')
150 '123456789-12345')
@@ -152,7 +152,7 b" show('data/Z23456789-123456789-123456789"
152 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
152 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
153 '123456789-12345')
153 '123456789-12345')
154
154
155 print "compare with lowercase not hitting limit"
155 print("compare with lowercase not hitting limit")
156 show('data/a23456789-123456789-123456789-123456789-123456789-'
156 show('data/a23456789-123456789-123456789-123456789-123456789-'
157 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
157 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
158 '123456789-12345')
158 '123456789-12345')
@@ -160,22 +160,22 b" show('data/z23456789-123456789-123456789"
160 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
160 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
161 '123456789-12345')
161 '123456789-12345')
162
162
163 print "not hitting limit with any of these"
163 print("not hitting limit with any of these")
164 show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;="
164 show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;="
165 "[]^`{}xxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-"
165 "[]^`{}xxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-"
166 "123456789-12345")
166 "123456789-12345")
167
167
168 print "underbar hitting length limit due to encoding"
168 print("underbar hitting length limit due to encoding")
169 show('data/_23456789-123456789-123456789-123456789-123456789-'
169 show('data/_23456789-123456789-123456789-123456789-123456789-'
170 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
170 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
171 '123456789-12345')
171 '123456789-12345')
172
172
173 print "tilde hitting length limit due to encoding"
173 print("tilde hitting length limit due to encoding")
174 show('data/~23456789-123456789-123456789-123456789-123456789-'
174 show('data/~23456789-123456789-123456789-123456789-123456789-'
175 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
175 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
176 '123456789-12345')
176 '123456789-12345')
177
177
178 print "Windows reserved characters hitting length limit"
178 print("Windows reserved characters hitting length limit")
179 show('data/<23456789-123456789-123456789-123456789-123456789-'
179 show('data/<23456789-123456789-123456789-123456789-123456789-'
180 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
180 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
181 '123456789-12345')
181 '123456789-12345')
@@ -201,47 +201,47 b" show('data/*23456789-123456789-123456789"
201 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
201 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
202 '123456789-12345')
202 '123456789-12345')
203
203
204 print "initial space hitting length limit"
204 print("initial space hitting length limit")
205 show('data/ 23456789-123456789-123456789-123456789-123456789-'
205 show('data/ 23456789-123456789-123456789-123456789-123456789-'
206 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
206 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
207 '123456789-12345')
207 '123456789-12345')
208
208
209 print "initial dot hitting length limit"
209 print("initial dot hitting length limit")
210 show('data/.23456789-123456789-123456789-123456789-123456789-'
210 show('data/.23456789-123456789-123456789-123456789-123456789-'
211 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
211 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
212 '123456789-12345')
212 '123456789-12345')
213
213
214 print "trailing space in filename hitting length limit"
214 print("trailing space in filename hitting length limit")
215 show('data/123456789-123456789-123456789-123456789-123456789-'
215 show('data/123456789-123456789-123456789-123456789-123456789-'
216 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
216 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
217 '123456789-1234 ')
217 '123456789-1234 ')
218
218
219 print "trailing dot in filename hitting length limit"
219 print("trailing dot in filename hitting length limit")
220 show('data/123456789-123456789-123456789-123456789-123456789-'
220 show('data/123456789-123456789-123456789-123456789-123456789-'
221 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
221 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
222 '123456789-1234.')
222 '123456789-1234.')
223
223
224 print "initial space in directory hitting length limit"
224 print("initial space in directory hitting length limit")
225 show('data/ x/456789-123456789-123456789-123456789-123456789-'
225 show('data/ x/456789-123456789-123456789-123456789-123456789-'
226 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
226 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
227 '123456789-12345')
227 '123456789-12345')
228
228
229 print "initial dot in directory hitting length limit"
229 print("initial dot in directory hitting length limit")
230 show('data/.x/456789-123456789-123456789-123456789-123456789-'
230 show('data/.x/456789-123456789-123456789-123456789-123456789-'
231 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
231 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
232 '123456789-12345')
232 '123456789-12345')
233
233
234 print "trailing space in directory hitting length limit"
234 print("trailing space in directory hitting length limit")
235 show('data/x /456789-123456789-123456789-123456789-123456789-'
235 show('data/x /456789-123456789-123456789-123456789-123456789-'
236 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
236 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
237 '123456789-12345')
237 '123456789-12345')
238
238
239 print "trailing dot in directory hitting length limit"
239 print("trailing dot in directory hitting length limit")
240 show('data/x./456789-123456789-123456789-123456789-123456789-'
240 show('data/x./456789-123456789-123456789-123456789-123456789-'
241 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
241 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
242 '123456789-12345')
242 '123456789-12345')
243
243
244 print "with directories that need direncoding, hitting length limit"
244 print("with directories that need direncoding, hitting length limit")
245 show('data/x.i/56789-123456789-123456789-123456789-123456789-'
245 show('data/x.i/56789-123456789-123456789-123456789-123456789-'
246 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
246 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
247 '123456789-12345')
247 '123456789-12345')
@@ -252,7 +252,7 b" show('data/x.hg/5789-123456789-123456789"
252 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
252 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
253 '123456789-12345')
253 '123456789-12345')
254
254
255 print "Windows reserved filenames, hitting length limit"
255 print("Windows reserved filenames, hitting length limit")
256 show('data/con/56789-123456789-123456789-123456789-123456789-'
256 show('data/con/56789-123456789-123456789-123456789-123456789-'
257 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
257 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
258 '123456789-12345')
258 '123456789-12345')
@@ -278,100 +278,100 b" show('data/lpt9/6789-123456789-123456789"
278 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
278 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
279 '123456789-12345')
279 '123456789-12345')
280
280
281 print "non-reserved names, just not hitting limit"
281 print("non-reserved names, just not hitting limit")
282 show('data/123456789-123456789-123456789-123456789-123456789-'
282 show('data/123456789-123456789-123456789-123456789-123456789-'
283 '/com/com0/lpt/lpt0/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
283 '/com/com0/lpt/lpt0/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
284 '123456789-12345')
284 '123456789-12345')
285
285
286 print "hashed path with largest untruncated 1st dir"
286 print("hashed path with largest untruncated 1st dir")
287 show('data/12345678/-123456789-123456789-123456789-123456789-'
287 show('data/12345678/-123456789-123456789-123456789-123456789-'
288 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
288 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
289 '123456789-123456')
289 '123456789-123456')
290
290
291 print "hashed path with smallest truncated 1st dir"
291 print("hashed path with smallest truncated 1st dir")
292 show('data/123456789/123456789-123456789-123456789-123456789-'
292 show('data/123456789/123456789-123456789-123456789-123456789-'
293 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
293 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
294 '123456789-123456')
294 '123456789-123456')
295
295
296 print "hashed path with largest untruncated two dirs"
296 print("hashed path with largest untruncated two dirs")
297 show('data/12345678/12345678/9-123456789-123456789-123456789-'
297 show('data/12345678/12345678/9-123456789-123456789-123456789-'
298 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
298 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
299 '123456789-123456')
299 '123456789-123456')
300
300
301 print "hashed path with smallest truncated two dirs"
301 print("hashed path with smallest truncated two dirs")
302 show('data/123456789/123456789/123456789-123456789-123456789-'
302 show('data/123456789/123456789/123456789-123456789-123456789-'
303 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
303 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
304 '123456789-123456')
304 '123456789-123456')
305
305
306 print "hashed path with largest untruncated three dirs"
306 print("hashed path with largest untruncated three dirs")
307 show('data/12345678/12345678/12345678/89-123456789-123456789-'
307 show('data/12345678/12345678/12345678/89-123456789-123456789-'
308 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
308 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
309 '123456789-123456')
309 '123456789-123456')
310
310
311 print "hashed path with smallest truncated three dirs"
311 print("hashed path with smallest truncated three dirs")
312 show('data/123456789/123456789/123456789/123456789-123456789-'
312 show('data/123456789/123456789/123456789/123456789-123456789-'
313 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
313 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
314 '123456789-123456')
314 '123456789-123456')
315
315
316 print "hashed path with largest untruncated four dirs"
316 print("hashed path with largest untruncated four dirs")
317 show('data/12345678/12345678/12345678/12345678/789-123456789-'
317 show('data/12345678/12345678/12345678/12345678/789-123456789-'
318 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
318 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
319 '123456789-123456')
319 '123456789-123456')
320
320
321 print "hashed path with smallest truncated four dirs"
321 print("hashed path with smallest truncated four dirs")
322 show('data/123456789/123456789/123456789/123456789/123456789-'
322 show('data/123456789/123456789/123456789/123456789/123456789-'
323 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
323 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
324 '123456789-123456')
324 '123456789-123456')
325
325
326 print "hashed path with largest untruncated five dirs"
326 print("hashed path with largest untruncated five dirs")
327 show('data/12345678/12345678/12345678/12345678/12345678/6789-'
327 show('data/12345678/12345678/12345678/12345678/12345678/6789-'
328 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
328 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
329 '123456789-123456')
329 '123456789-123456')
330
330
331 print "hashed path with smallest truncated five dirs"
331 print("hashed path with smallest truncated five dirs")
332 show('data/123456789/123456789/123456789/123456789/123456789/'
332 show('data/123456789/123456789/123456789/123456789/123456789/'
333 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
333 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
334 '123456789-123456')
334 '123456789-123456')
335
335
336 print "hashed path with largest untruncated six dirs"
336 print("hashed path with largest untruncated six dirs")
337 show('data/12345678/12345678/12345678/12345678/12345678/12345'
337 show('data/12345678/12345678/12345678/12345678/12345678/12345'
338 '678/ed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
338 '678/ed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
339 '123456789-123456')
339 '123456789-123456')
340
340
341 print "hashed path with smallest truncated six dirs"
341 print("hashed path with smallest truncated six dirs")
342 show('data/123456789/123456789/123456789/123456789/123456789/'
342 show('data/123456789/123456789/123456789/123456789/123456789/'
343 '123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
343 '123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
344 '123456789-123456')
344 '123456789-123456')
345
345
346 print "hashed path with largest untruncated seven dirs"
346 print("hashed path with largest untruncated seven dirs")
347 show('data/12345678/12345678/12345678/12345678/12345678/12345'
347 show('data/12345678/12345678/12345678/12345678/12345678/12345'
348 '678/12345678/xxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
348 '678/12345678/xxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
349 '123456789-123456')
349 '123456789-123456')
350
350
351 print "hashed path with smallest truncated seven dirs"
351 print("hashed path with smallest truncated seven dirs")
352 show('data/123456789/123456789/123456789/123456789/123456789/'
352 show('data/123456789/123456789/123456789/123456789/123456789/'
353 '123456789/123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
353 '123456789/123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
354 '123456789-123456')
354 '123456789-123456')
355
355
356 print "hashed path with largest untruncated eight dirs"
356 print("hashed path with largest untruncated eight dirs")
357 print "(directory 8 is dropped because it hits _maxshortdirslen)"
357 print("(directory 8 is dropped because it hits _maxshortdirslen)")
358 show('data/12345678/12345678/12345678/12345678/12345678/12345'
358 show('data/12345678/12345678/12345678/12345678/12345678/12345'
359 '678/12345678/12345678/xxxxxxx-xxxxxxxxx-xxxxxxxxx-'
359 '678/12345678/12345678/xxxxxxx-xxxxxxxxx-xxxxxxxxx-'
360 '123456789-123456')
360 '123456789-123456')
361
361
362 print "hashed path with smallest truncated eight dirs"
362 print("hashed path with smallest truncated eight dirs")
363 print "(directory 8 is dropped because it hits _maxshortdirslen)"
363 print("(directory 8 is dropped because it hits _maxshortdirslen)")
364 show('data/123456789/123456789/123456789/123456789/123456789/'
364 show('data/123456789/123456789/123456789/123456789/123456789/'
365 '123456789/123456789/123456789/xxxxxxxxx-xxxxxxxxx-'
365 '123456789/123456789/123456789/xxxxxxxxx-xxxxxxxxx-'
366 '123456789-123456')
366 '123456789-123456')
367
367
368 print "hashed path with largest non-dropped directory 8"
368 print("hashed path with largest non-dropped directory 8")
369 print "(just not hitting the _maxshortdirslen boundary)"
369 print("(just not hitting the _maxshortdirslen boundary)")
370 show('data/12345678/12345678/12345678/12345678/12345678/12345'
370 show('data/12345678/12345678/12345678/12345678/12345678/12345'
371 '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
371 '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
372 '123456789-123456')
372 '123456789-123456')
373
373
374 print "...adding one truncated char to dir 1..7 won't drop dir 8"
374 print("...adding one truncated char to dir 1..7 won't drop dir 8")
375 show('data/12345678x/12345678/12345678/12345678/12345678/12345'
375 show('data/12345678x/12345678/12345678/12345678/12345678/12345'
376 '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
376 '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
377 '123456789-123456')
377 '123456789-123456')
@@ -394,14 +394,14 b" show('data/12345678/12345678/12345678/12"
394 '678/12345678x/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
394 '678/12345678x/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
395 '123456789-123456')
395 '123456789-123456')
396
396
397 print "hashed path with shortest dropped directory 8"
397 print("hashed path with shortest dropped directory 8")
398 print "(just hitting the _maxshortdirslen boundary)"
398 print("(just hitting the _maxshortdirslen boundary)")
399 show('data/12345678/12345678/12345678/12345678/12345678/12345'
399 show('data/12345678/12345678/12345678/12345678/12345678/12345'
400 '678/12345678/123456/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
400 '678/12345678/123456/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
401 '123456789-123456')
401 '123456789-123456')
402
402
403 print "hashed path that drops dir 8 due to dot or space at end is"
403 print("hashed path that drops dir 8 due to dot or space at end is")
404 print "encoded, and thus causing to hit _maxshortdirslen"
404 print("encoded, and thus causing to hit _maxshortdirslen")
405 show('data/12345678/12345678/12345678/12345678/12345678/12345'
405 show('data/12345678/12345678/12345678/12345678/12345678/12345'
406 '678/12345678/1234./-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
406 '678/12345678/1234./-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
407 '123456789-123456')
407 '123456789-123456')
@@ -409,7 +409,7 b" show('data/12345678/12345678/12345678/12"
409 '678/12345678/1234 /-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
409 '678/12345678/1234 /-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
410 '123456789-123456')
410 '123456789-123456')
411
411
412 print "... with dir 8 short enough for encoding"
412 print("... with dir 8 short enough for encoding")
413 show('data/12345678/12345678/12345678/12345678/12345678/12345'
413 show('data/12345678/12345678/12345678/12345678/12345678/12345'
414 '678/12345678/12./xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
414 '678/12345678/12./xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
415 '123456789-123456')
415 '123456789-123456')
@@ -417,9 +417,9 b" show('data/12345678/12345678/12345678/12"
417 '678/12345678/12 /xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
417 '678/12345678/12 /xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
418 '123456789-123456')
418 '123456789-123456')
419
419
420 print '''Extensions are replicated on hashed paths. Note that
420 print('''Extensions are replicated on hashed paths. Note that
421 we only get to encode files that end in .i or .d inside the
421 we only get to encode files that end in .i or .d inside the
422 store. Encoded filenames are thus bound in length.'''
422 store. Encoded filenames are thus bound in length.''')
423 show('data/12345678/12345678/12345678/12345678/12345678/12345'
423 show('data/12345678/12345678/12345678/12345678/12345678/12345'
424 '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
424 '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
425 '123456789-12.345.i')
425 '123456789-12.345.i')
@@ -464,7 +464,7 b" show('data/12345678/12345678/12345678/12"
464 'xxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwww'
464 'xxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwww'
465 'wwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww.i')
465 'wwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww.i')
466
466
467 print "paths outside data/ can be encoded"
467 print("paths outside data/ can be encoded")
468 show('metadata/dir/00manifest.i')
468 show('metadata/dir/00manifest.i')
469 show('metadata/12345678/12345678/12345678/12345678/12345678/'
469 show('metadata/12345678/12345678/12345678/12345678/12345678/'
470 '12345678/12345678/12345678/12345678/12345678/12345678/'
470 '12345678/12345678/12345678/12345678/12345678/12345678/'
General Comments 0
You need to be logged in to leave comments. Login now