view mercurial/node.py @ 15976:d1c74c6151c9 stable

copies: eliminate criss-crosses when chaining Before the copies refactoring, we declared that if a and b were present in source and destination, we ignored copies between them. The refactored code could however report b was a copy of a and vice versa in a situation where we looked for differences between two identical changesets that copy a to b. y / x \ y'
author Matt Mackall <mpm@selenic.com>
date Tue, 24 Jan 2012 17:16:29 -0600
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])