view mercurial/node.py @ 20973:55543ee545ab

hgweb: override the charset attribute in the http request The default http request character set is UTF-8. If the message is not encoded in UTF-8, such as big5, it cannot be shown correctly. The 'charset' is overridden by the root document's, such that the user can select the proper encoding in the browser.
author Wei, Elson <elson.wei@gmail.com>
date Thu, 10 Apr 2014 15:12:12 +0800
parents 25e572394f5c
children 1a5211f2f87f
line wrap: on
line source

# 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])