Show More
@@ -183,7 +183,6 b' unexpectedly::' | |||||
183 |
|
183 | |||
184 | from __future__ import absolute_import |
|
184 | from __future__ import absolute_import | |
185 |
|
185 | |||
186 | import binascii |
|
|||
187 | import errno |
|
186 | import errno | |
188 | import os |
|
187 | import os | |
189 |
|
188 | |||
@@ -426,7 +425,7 b' class histeditaction(object):' | |||||
426 | rulehash = rule.strip().split(' ', 1)[0] |
|
425 | rulehash = rule.strip().split(' ', 1)[0] | |
427 | try: |
|
426 | try: | |
428 | rev = node.bin(rulehash) |
|
427 | rev = node.bin(rulehash) | |
429 |
except |
|
428 | except TypeError: | |
430 | raise error.ParseError("invalid changeset %s" % rulehash) |
|
429 | raise error.ParseError("invalid changeset %s" % rulehash) | |
431 | return cls(state, rev) |
|
430 | return cls(state, rev) | |
432 |
|
431 |
@@ -11,7 +11,14 b' 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 |
@@ -13,7 +13,6 b' and O(changes) merge between branches.' | |||||
13 |
|
13 | |||
14 | from __future__ import absolute_import |
|
14 | from __future__ import absolute_import | |
15 |
|
15 | |||
16 | import binascii |
|
|||
17 | import collections |
|
16 | import collections | |
18 | import contextlib |
|
17 | import contextlib | |
19 | import errno |
|
18 | import errno | |
@@ -1430,7 +1429,7 b' class revlog(object):' | |||||
1430 | if maybewdir: |
|
1429 | if maybewdir: | |
1431 | raise error.WdirUnsupported |
|
1430 | raise error.WdirUnsupported | |
1432 | return None |
|
1431 | return None | |
1433 |
except |
|
1432 | except TypeError: | |
1434 | pass |
|
1433 | pass | |
1435 |
|
1434 | |||
1436 | def lookup(self, id): |
|
1435 | def lookup(self, id): |
General Comments 0
You need to be logged in to leave comments.
Login now