Show More
@@ -1,23 +1,25 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 | |||
|
9 | ||||
8 | import binascii |
|
10 | import binascii | |
9 |
|
11 | |||
10 | nullrev = -1 |
|
12 | nullrev = -1 | |
11 | nullid = "\0" * 20 |
|
13 | nullid = "\0" * 20 | |
12 |
|
14 | |||
13 | # pseudo identifiers for working directory |
|
15 | # pseudo identifiers for working directory | |
14 | # (they are experimental, so don't add too many dependencies on them) |
|
16 | # (they are experimental, so don't add too many dependencies on them) | |
15 | wdirrev = 0x7fffffff |
|
17 | wdirrev = 0x7fffffff | |
16 | wdirid = "\xff" * 20 |
|
18 | wdirid = "\xff" * 20 | |
17 |
|
19 | |||
18 | # This ugly style has a noticeable effect in manifest parsing |
|
20 | # This ugly style has a noticeable effect in manifest parsing | |
19 | hex = binascii.hexlify |
|
21 | hex = binascii.hexlify | |
20 | bin = binascii.unhexlify |
|
22 | bin = binascii.unhexlify | |
21 |
|
23 | |||
22 | def short(node): |
|
24 | def short(node): | |
23 | return hex(node[:6]) |
|
25 | return hex(node[:6]) |
General Comments 0
You need to be logged in to leave comments.
Login now