equal
deleted
inserted
replaced
9 |
9 |
10 import binascii |
10 import binascii |
11 |
11 |
12 # This ugly style has a noticeable effect in manifest parsing |
12 # This ugly style has a noticeable effect in manifest parsing |
13 hex = binascii.hexlify |
13 hex = binascii.hexlify |
14 bin = binascii.unhexlify |
14 # Adapt to Python 3 API changes. If this ends up showing up in |
|
15 # profiles, we can use this version only on Python 3, and forward |
|
16 # binascii.unhexlify like we used to on Python 2. |
|
17 def bin(s): |
|
18 try: |
|
19 return binascii.unhexlify(s) |
|
20 except binascii.Error as e: |
|
21 raise TypeError(e) |
15 |
22 |
16 nullrev = -1 |
23 nullrev = -1 |
17 nullid = b"\0" * 20 |
24 nullid = b"\0" * 20 |
18 nullhex = hex(nullid) |
25 nullhex = hex(nullid) |
19 |
26 |