node: define experimental identifiers for working directory
authorYuya Nishihara <yuya@tcha.org>
Mon, 22 Jun 2015 22:01:33 +0900
changeset 25737 1a5211f2f87f
parent 25736 8854ca3fa675
child 25738 04d26a3c96fd
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.
mercurial/node.py
--- a/mercurial/node.py	Sat Mar 14 17:58:18 2015 +0900
+++ b/mercurial/node.py	Mon Jun 22 22:01:33 2015 +0900
@@ -10,6 +10,11 @@
 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