changeset 27049:0d61f7ec7f76

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.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 14 Nov 2015 00:07:11 -0800
parents 86290f6f6599
children df9b73d2d444
files mercurial/merge.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Nov 20 01:14:15 2015 -0800
+++ b/mercurial/merge.py	Sat Nov 14 00:07:11 2015 -0800
@@ -366,8 +366,11 @@
 
         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()),