comparison mercurial/revlog.py @ 38655:cd1c484e31e8

revlog: adjust doctest examples to be portable to Python 3 The range() builtin returns a special object rather than a list, but we really wanted a list in these examples. Differential Revision: https://phab.mercurial-scm.org/D3922
author Augie Fackler <augie@google.com>
date Wed, 11 Jul 2018 11:34:41 -0400
parents 43d0619cec90
children 93d9690ff2b0
comparison
equal deleted inserted replaced
38654:0d27d6bcfb28 38655:cd1c484e31e8
327 ... 85, #13 (11) 327 ... 85, #13 (11)
328 ... 86, #14 (1) 328 ... 86, #14 (1)
329 ... 91, #15 (5) 329 ... 91, #15 (5)
330 ... ]) 330 ... ])
331 331
332 >>> list(_slicechunk(revlog, range(16))) 332 >>> list(_slicechunk(revlog, list(range(16))))
333 [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]] 333 [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
334 >>> list(_slicechunk(revlog, [0, 15])) 334 >>> list(_slicechunk(revlog, [0, 15]))
335 [[0], [15]] 335 [[0], [15]]
336 >>> list(_slicechunk(revlog, [0, 11, 15])) 336 >>> list(_slicechunk(revlog, [0, 11, 15]))
337 [[0], [11], [15]] 337 [[0], [11], [15]]
458 ... 85, #13 (11) 458 ... 85, #13 (11)
459 ... 86, #14 (1) 459 ... 86, #14 (1)
460 ... 91, #15 (5) 460 ... 91, #15 (5)
461 ... ]) 461 ... ])
462 462
463 >>> list(_slicechunktodensity(revlog, range(16))) 463 >>> list(_slicechunktodensity(revlog, list(range(16))))
464 [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]] 464 [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
465 >>> list(_slicechunktodensity(revlog, [0, 15])) 465 >>> list(_slicechunktodensity(revlog, [0, 15]))
466 [[0], [15]] 466 [[0], [15]]
467 >>> list(_slicechunktodensity(revlog, [0, 11, 15])) 467 >>> list(_slicechunktodensity(revlog, [0, 11, 15]))
468 [[0], [11], [15]] 468 [[0], [11], [15]]