mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
treemanifest: store p1,p2 in the temporary memtrees
Previously, if during the middle a transaction something needed to access a tree for a commit that was created during the transaction, the manifestlog could find that tree in a side store it kept for current transaction trees. Unfortunatley we were only storing the data, and not the parents, so if logic needed the parents it failed with a key error. The fix is to just store the parents as well. This was caught by the sparse extension, which looks at the current tree during a commit when a sparse profile changes.
This commit is contained in:
parent
99a01a0dbd
commit
0ce07c511d
@ -316,9 +316,10 @@ class treeonlymanifestlog(object):
|
||||
|
||||
return treemanifestctx(self, dir, node)
|
||||
|
||||
def addmemtree(self, node, tree):
|
||||
def addmemtree(self, node, tree, p1, p2):
|
||||
ctx = treemanifestctx(self, '', node)
|
||||
ctx._data = tree
|
||||
ctx.parents = (p1, p2)
|
||||
self._memtrees[('', node)] = ctx
|
||||
|
||||
def clearcaches(self):
|
||||
@ -480,7 +481,7 @@ class memtreemanifestctx(object):
|
||||
node = nnode
|
||||
|
||||
if node is not None:
|
||||
self._manifestlog.addmemtree(node, newtree)
|
||||
self._manifestlog.addmemtree(node, newtree, p1, p2)
|
||||
return node
|
||||
|
||||
def serverreposetup(repo):
|
||||
|
Loading…
Reference in New Issue
Block a user