Mercurial > hg-stable
changeset 26980:18f50b8cbf1e
node: add 'nullhex', hex-encoded nullid
We're going to need this for upcoming changes, because the merge state stores
nodes as hex strings.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 16 Nov 2015 11:23:32 -0800 |
parents | 7b038ec6c5fd |
children | cda2e980281e |
files | mercurial/node.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/node.py Mon Nov 16 11:45:35 2015 -0800 +++ b/mercurial/node.py Mon Nov 16 11:23:32 2015 -0800 @@ -9,17 +9,18 @@ import binascii +# This ugly style has a noticeable effect in manifest parsing +hex = binascii.hexlify +bin = binascii.unhexlify + nullrev = -1 nullid = "\0" * 20 +nullhex = hex(nullid) # pseudo identifiers for working directory # (they are experimental, so don't add too many dependencies on them) wdirrev = 0x7fffffff wdirid = "\xff" * 20 -# This ugly style has a noticeable effect in manifest parsing -hex = binascii.hexlify -bin = binascii.unhexlify - def short(node): return hex(node[:6])