mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
83b08b045e
The "ff..." node was introduced at 187c3ec3d83f, 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.
24 lines
605 B
Python
24 lines
605 B
Python
# node.py - basic nodeid manipulation for mercurial
|
|
#
|
|
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
|
|
#
|
|
# This software may be used and distributed according to the terms of the
|
|
# GNU General Public License version 2 or any later version.
|
|
|
|
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
|
|
|
|
def short(node):
|
|
return hex(node[:6])
|