2009-04-26 03:13:08 +04:00
|
|
|
# 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
|
2010-01-20 07:20:08 +03:00
|
|
|
# GNU General Public License version 2 or any later version.
|
2005-08-28 01:21:25 +04:00
|
|
|
|
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])
|