view mercurial/node.py @ 2036:c9226bcc288d

Don't abort when backup files already exist. Don't allow alternative names. Rationale: - When the user wants to revert, he shouldn't be stopped from doing this just because some old backups will be overwritten. - To not clobber important files by accident, alternative names for backup files were disabled. As the backup target now has a fixed name, the user doesn't have to be informed about the backup copy (unless --verbose)
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 01 Apr 2006 11:58:50 +0200
parents bf4e7ef08741
children
line wrap: on
line source

"""
node.py - basic nodeid manipulation for mercurial

Copyright 2005 Matt Mackall <mpm@selenic.com>

This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
"""

import binascii

nullid = "\0" * 20

def hex(node):
    return binascii.hexlify(node)

def bin(node):
    return binascii.unhexlify(node)

def short(node):
    return hex(node[:6])