mercurial/node.py
author Matt Harbison <matt_harbison@yahoo.com>
Sun, 14 Oct 2012 14:44:08 -0400
changeset 17823 0fc1ce271ee6
parent 10263 25e572394f5c
child 25737 1a5211f2f87f
permissions -rw-r--r--
largefiles: fix a traceback in lfconvert if a largefile is missing (issue3519) The largefile may be missing for various reasons, including that a remote repository was cloned without the --all-largefiles option. Therefore, it seems reasonable to attempt to download the missing files and failing that, abort and indicate the affected file and revision so the user can manually fix the problem.

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