hg: move fastmanifest specific logic out of tree write helper

Summary:
A future diff will be removing the fastmanifest tree write helper. To
simplify that transition, let's move all the fastmanifest specific logic out of
the fastmanifest helper function.

Reviewed By: ryanmce

Differential Revision: D7083054

fbshipit-source-id: bf023efb857af2511b4ed7ae7ef069ee15575f08
This commit is contained in:
Durham Goode 2018-02-27 11:10:17 -08:00 committed by Saurabh Singh
parent 1077037f2e
commit 7abe8756d1

View File

@ -1055,6 +1055,13 @@ class manifestfactory(object):
node = _writetree(mfl, transaction, newtree, tree, node, p1)
treemanifestcache.getinstance(opener,
mfl.ui)[node] = newtree
def finalize(tr):
treemanifestcache.getinstance(opener,
mfl.ui).clear()
transaction.addfinalize('fastmanifesttreecache', finalize)
return node
def _writetree(mfl, transaction, newtree, tree, node, p1):
@ -1074,8 +1081,6 @@ def _writetree(mfl, transaction, newtree, tree, node, p1):
def finalize(tr):
tr.treedatapack.close()
tr.treehistpack.close()
treemanifestcache.getinstance(opener,
mfl.ui).clear()
datastore.markforrefresh()
def writepending(tr):
@ -1123,9 +1128,6 @@ def _writetree(mfl, transaction, newtree, tree, node, p1):
dpack.add(nname, nnode, revlog.nullid, ntext)
hpack.add(nname, nnode, np1, np2, revlog.nullid, '')
treemanifestcache.getinstance(opener,
mfl.ui)[node] = newtree
return node
def _silent_debug(*args, **kwargs):