Mercurial > hg
comparison tests/revlog-formatv0.py @ 36565:9805c906aaad
tests: port helper script revlog-formatv0.py to python 3
Differential Revision: https://phab.mercurial-scm.org/D2540
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 01 Mar 2018 23:58:04 -0500 |
parents | 3e3f4c03876b |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
36564:c4ccc73f9d49 | 36565:9805c906aaad |
---|---|
16 description: | 16 description: |
17 empty file | 17 empty file |
18 """ | 18 """ |
19 | 19 |
20 from __future__ import absolute_import | 20 from __future__ import absolute_import |
21 import binascii | |
21 import os | 22 import os |
22 import sys | 23 import sys |
23 | 24 |
24 files = [ | 25 files = [ |
25 (b'formatv0/.hg/00changelog.i', | 26 (b'formatv0/.hg/00changelog.i', |
54 | 55 |
55 makedirs(os.path.join(*'formatv0/.hg/data'.split('/'))) | 56 makedirs(os.path.join(*'formatv0/.hg/data'.split('/'))) |
56 | 57 |
57 for name, data in files: | 58 for name, data in files: |
58 f = open(name, 'wb') | 59 f = open(name, 'wb') |
59 f.write(data.decode('hex')) | 60 f.write(binascii.unhexlify(data)) |
60 f.close() | 61 f.close() |
61 | 62 |
62 sys.exit(0) | 63 sys.exit(0) |