mergestate.add: store absentfilectxes as nullhex

This is the most natural way to represent these files. We also need to make
sure we don't try to store these files in the merge store.
This commit is contained in:
Siddharth Agarwal 2015-11-14 00:07:11 -08:00
parent 328287680c
commit 5d6cb7e78f

View File

@ -366,8 +366,11 @@ class mergestate(object):
note: also write the local version to the `.hg/merge` directory.
"""
hash = util.sha1(fcl.path()).hexdigest()
self._repo.vfs.write('merge/' + hash, fcl.data())
if fcl.isabsent():
hash = nullhex
else:
hash = util.sha1(fcl.path()).hexdigest()
self._repo.vfs.write('merge/' + hash, fcl.data())
self._state[fd] = ['u', hash, fcl.path(),
fca.path(), hex(fca.filenode()),
fco.path(), hex(fco.filenode()),