[PATCH 6 of 7 mergedriver] node: add 'nullhex', hex-encoded nullid

Siddharth Agarwal sid0 at fb.com
Mon Nov 16 17:46:10 CST 2015


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1447701812 28800
#      Mon Nov 16 11:23:32 2015 -0800
# Node ID c56137c086886035f7798a28d901bd794def8680
# Parent  91b518d4c3f5854f7443bf73467e5d0d83cec01f
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])


More information about the Mercurial-devel mailing list