# HG changeset patch # User Siddharth Agarwal # Date 2015-11-16 19:23:32 # Node ID 18f50b8cbf1ea6e42d6f78237a6bb3ec64e99682 # Parent 7b038ec6c5fda8b916d384ae6127fb0db5553a31 node: add 'nullhex', hex-encoded nullid We're going to need this for upcoming changes, because the merge state stores nodes as hex strings. diff --git a/mercurial/node.py b/mercurial/node.py --- a/mercurial/node.py +++ b/mercurial/node.py @@ -9,17 +9,18 @@ from __future__ import absolute_import 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])