[PATCH 3 of 6] node: define experimental identifiers for working directory

Yuya Nishihara yuya at tcha.org
Thu Jul 2 10:17:02 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1434978093 -32400
#      Mon Jun 22 22:01:33 2015 +0900
# Node ID 858caee64050c937be4ff2f38e23b9d6c039feba
# Parent  8f50b986609b29dd28049ce145e39c3671c78c37
node: define experimental identifiers for working directory

The "ff..." node was introduced at 183965a00c76, and we also need an integer
that can be processed in revset. We could use len(repo), but it would be
likely to hide possible bugs. Instead, using INT_MAX, we can notice such bugs
by IndexError, at the cost of handling non-contiguous revisions.

diff --git a/mercurial/node.py b/mercurial/node.py
--- a/mercurial/node.py
+++ b/mercurial/node.py
@@ -10,6 +10,11 @@ import binascii
 nullrev = -1
 nullid = "\0" * 20
 
+# 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


More information about the Mercurial-devel mailing list