view mercurial/node.py @ 11791:00cde9bddbe4

repair: do not compress partial bundle if we do not keep it on disk A partial bundle is created to temporarily save revisions > rev but not descending from the node to strip, to be able to restore the changesets after stripping the changelog. Since this bundle is not kept after the strip operation, and is not user-visible, it is not necessary and should be faster to avoid compression.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 12 Aug 2010 16:53:23 +0900
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])