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

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 16, 2015, 11:46 p.m.
Message ID <c56137c086886035f779.1447717570@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11421/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 16, 2015, 11:46 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.
Martin von Zweigbergk - Nov. 17, 2015, 5:09 a.m.
This has been pushed to the clowncopter, thanks, but I'm dropping
patch 7/7 as we talked about.

On Mon, Nov 16, 2015 at 3:46 PM, Siddharth Agarwal <sid0@fb.com> wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@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])
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

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])