Show More
@@ -1,25 +1,26 b'' | |||||
1 | # node.py - basic nodeid manipulation for mercurial |
|
1 | # node.py - basic nodeid manipulation for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | from __future__ import absolute_import |
|
8 | from __future__ import absolute_import | |
9 |
|
9 | |||
10 | import binascii |
|
10 | import binascii | |
11 |
|
11 | |||
|
12 | # This ugly style has a noticeable effect in manifest parsing | |||
|
13 | hex = binascii.hexlify | |||
|
14 | bin = binascii.unhexlify | |||
|
15 | ||||
12 | nullrev = -1 |
|
16 | nullrev = -1 | |
13 | nullid = "\0" * 20 |
|
17 | nullid = "\0" * 20 | |
|
18 | nullhex = hex(nullid) | |||
14 |
|
19 | |||
15 | # pseudo identifiers for working directory |
|
20 | # pseudo identifiers for working directory | |
16 | # (they are experimental, so don't add too many dependencies on them) |
|
21 | # (they are experimental, so don't add too many dependencies on them) | |
17 | wdirrev = 0x7fffffff |
|
22 | wdirrev = 0x7fffffff | |
18 | wdirid = "\xff" * 20 |
|
23 | wdirid = "\xff" * 20 | |
19 |
|
24 | |||
20 | # This ugly style has a noticeable effect in manifest parsing |
|
|||
21 | hex = binascii.hexlify |
|
|||
22 | bin = binascii.unhexlify |
|
|||
23 |
|
||||
24 | def short(node): |
|
25 | def short(node): | |
25 | return hex(node[:6]) |
|
26 | return hex(node[:6]) |
General Comments 0
You need to be logged in to leave comments.
Login now