comparison tests/revlog-formatv0.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents 9805c906aaad
children c102b704edb5
comparison
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
21 import binascii 21 import binascii
22 import os 22 import os
23 import sys 23 import sys
24 24
25 files = [ 25 files = [
26 (b'formatv0/.hg/00changelog.i', 26 (
27 b'000000000000004400000000000000000000000000000000000000' 27 b'formatv0/.hg/00changelog.i',
28 b'000000000000000000000000000000000000000000000000000000' 28 b'000000000000004400000000000000000000000000000000000000'
29 b'0000a1ef0b125355d27765928be600cfe85784284ab3'), 29 b'000000000000000000000000000000000000000000000000000000'
30 (b'formatv0/.hg/00changelog.d', 30 b'0000a1ef0b125355d27765928be600cfe85784284ab3',
31 b'756163613935613961356635353036303562366138343738336237' 31 ),
32 b'61623536363738616436356635380a757365720a3020300a656d70' 32 (
33 b'74790a0a656d7074792066696c65'), 33 b'formatv0/.hg/00changelog.d',
34 (b'formatv0/.hg/00manifest.i', 34 b'756163613935613961356635353036303562366138343738336237'
35 b'000000000000003000000000000000000000000000000000000000' 35 b'61623536363738616436356635380a757365720a3020300a656d70'
36 b'000000000000000000000000000000000000000000000000000000' 36 b'74790a0a656d7074792066696c65',
37 b'0000aca95a9a5f550605b6a84783b7ab56678ad65f58'), 37 ),
38 (b'formatv0/.hg/00manifest.d', 38 (
39 b'75656d707479006238306465356431333837353835343163356630' 39 b'formatv0/.hg/00manifest.i',
40 b'35323635616431343461623966613836643164620a'), 40 b'000000000000003000000000000000000000000000000000000000'
41 (b'formatv0/.hg/data/empty.i', 41 b'000000000000000000000000000000000000000000000000000000'
42 b'000000000000000000000000000000000000000000000000000000' 42 b'0000aca95a9a5f550605b6a84783b7ab56678ad65f58',
43 b'000000000000000000000000000000000000000000000000000000' 43 ),
44 b'0000b80de5d138758541c5f05265ad144ab9fa86d1db'), 44 (
45 (b'formatv0/.hg/data/empty.d', 45 b'formatv0/.hg/00manifest.d',
46 b''), 46 b'75656d707479006238306465356431333837353835343163356630'
47 b'35323635616431343461623966613836643164620a',
48 ),
49 (
50 b'formatv0/.hg/data/empty.i',
51 b'000000000000000000000000000000000000000000000000000000'
52 b'000000000000000000000000000000000000000000000000000000'
53 b'0000b80de5d138758541c5f05265ad144ab9fa86d1db',
54 ),
55 (b'formatv0/.hg/data/empty.d', b''),
47 ] 56 ]
57
48 58
49 def makedirs(name): 59 def makedirs(name):
50 """recursive directory creation""" 60 """recursive directory creation"""
51 parent = os.path.dirname(name) 61 parent = os.path.dirname(name)
52 if parent: 62 if parent:
53 makedirs(parent) 63 makedirs(parent)
54 os.mkdir(name) 64 os.mkdir(name)
65
55 66
56 makedirs(os.path.join(*'formatv0/.hg/data'.split('/'))) 67 makedirs(os.path.join(*'formatv0/.hg/data'.split('/')))
57 68
58 for name, data in files: 69 for name, data in files:
59 f = open(name, 'wb') 70 f = open(name, 'wb')