##// END OF EJS Templates
fileset, revset: do not use global parser object for thread safety...
fileset, revset: do not use global parser object for thread safety parse() cannot be called at the same time because a parser object keeps its states. This is no problem for command-line hg client, but it would cause strange errors in multi-threaded hgweb. Creating parser object is not too expensive. original: % python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")' 100000 loops, best of 3: 11.3 usec per loop thread-safe: % python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")' 100000 loops, best of 3: 13.1 usec per loop

File last commit:

r10263:25e57239 stable
r20208:61a47fd6 stable
Show More
node.py
18 lines | 449 B | text/x-python | PythonLexer
# 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])