2005-08-28 01:21:25 +04:00
|
|
|
"""
|
|
|
|
node.py - basic nodeid manipulation for mercurial
|
|
|
|
|
2006-08-12 23:30:02 +04:00
|
|
|
Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
|
2005-08-28 01:21:25 +04:00
|
|
|
|
|
|
|
This software may be used and distributed according to the terms
|
|
|
|
of the GNU General Public License, incorporated herein by reference.
|
|
|
|
"""
|
|
|
|
|
2006-12-13 22:27:09 +03:00
|
|
|
import binascii
|
2005-08-28 01:21:25 +04:00
|
|
|
|
2006-10-29 12:53:51 +03:00
|
|
|
nullrev = -1
|
2005-08-28 01:21:25 +04:00
|
|
|
nullid = "\0" * 20
|
|
|
|
|
2007-07-24 05:44:08 +04:00
|
|
|
# This ugly style has a noticeable effect in manifest parsing
|
|
|
|
hex = binascii.hexlify
|
|
|
|
bin = binascii.unhexlify
|
2005-08-28 01:21:25 +04:00
|
|
|
|
|
|
|
def short(node):
|
|
|
|
return hex(node[:6])
|