mercurial/node.py
author Adrian Buehlmann <adrian@cadifra.com>
Tue, 15 May 2012 22:36:47 +0200
changeset 16750 5b1f869b5548
parent 10263 25e572394f5c
child 25737 1a5211f2f87f
permissions -rw-r--r--
bdiff: check and cast first parameter value on putbe32() calls Eliminates mercurial/bdiff.c(383) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(384) : warning C4244: 'function' : conversion from '__int64' to 'uint32_t', possible loss of data mercurial/bdiff.c(385) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'uint32_t', possible loss of data when compiling for Windows x64 target using the Microsoft compiler.

# 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

# This ugly style has a noticeable effect in manifest parsing
hex = binascii.hexlify
bin = binascii.unhexlify

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