view mercurial/node.py @ 2562:a020024c5870

simplify make_filename, fix hg cat bug hg cat was using file-level rev/node ids for generating filename templates. This simplifies make_filename to only use changeset rev/node ids.
author Matt Mackall <mpm@selenic.com>
date Wed, 28 Jun 2006 17:06:56 -0500
parents fe1689273f84
children 345bac2bc4ec
line wrap: on
line source

"""
node.py - basic nodeid manipulation for mercurial

Copyright 2005 Matt Mackall <mpm@selenic.com>

This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
"""

from demandload import demandload
demandload(globals(), "binascii")

nullid = "\0" * 20

def hex(node):
    return binascii.hexlify(node)

def bin(node):
    return binascii.unhexlify(node)

def short(node):
    return hex(node[:6])