##// END OF EJS Templates
patch: stop modifying gitpatch objects...
patch: stop modifying gitpatch objects gitpatch objects emitted by iterhunks() were referencing file paths unmodified from the input patch. _applydif() made them usable by modifying the gitpatch objects in-place with specified path strip level. The same modified objects were then reused by iterhunks() generator. _applydiff() now copies and update the paths which completely decouples both routines. As a side effect, the "git" event now receives only metadata about copies/renames to perform the necessary copies ahead of time. Other actions are handled in the "file" event.

File last commit:

r10263:25e57239 stable
r14389:909ac6b9 default
Show More
node.py
18 lines | 449 B | text/x-python | PythonLexer
# 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])