mercurial/node.py
author Augie Fackler <durin42@gmail.com>
Thu, 23 Jun 2011 15:00:45 -0500
changeset 14838 5d261fd00446
parent 10263 25e572394f5c
child 25737 1a5211f2f87f
permissions -rw-r--r--
progress: add a changedelay to prevent parallel topics from flapping (issue2698) When combined with the earlier change to make the progress object truly a singleton, this prevents the progress bar swapping on 'hg clone --pull' on a local filesystem. Thanks to timeless for lots of debugging help at the Copenhagen sprint to isolate the root cause of this and a first draft an idea that would fix it.

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