mercurial/node.py
author Eric Sumner <ericsumner@fb.com>
Fri, 20 Feb 2015 13:55:01 -0800
changeset 24170 fbc4d550a6ab
parent 10263 25e572394f5c
child 25737 1a5211f2f87f
permissions -rw-r--r--
repair: setup hookargs when processing bundle2s addchangegroup() modifies its behavior based on the transaction source. This is incorrect for bundle2 repair files, causing rebases to abort when this option is enabled. This diff specifies the source type in the way recommended by comments in bundle2.py and adds a test to ensure that rebases with the experimental option work successfully.

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