mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
treemanifest: split _addtopack
Summary: In order to not have to deal with linkrev in mutablehistorypack, let's split _addtopack in 2. This will allow _addtreeentry to be wrapped later to deal with linkrev. Reviewed By: kulshrax Differential Revision: D15684625 fbshipit-source-id: 772ffa25ce7b72f95f057d0ae00c89c7dc91bf18
This commit is contained in:
parent
8fa3d943d9
commit
16da1f1b4a
@ -736,6 +736,14 @@ class basetreemanifestlog(object):
|
||||
def getmutablesharedpacks(self):
|
||||
return self._mutablesharedpacks.getmutablepack()
|
||||
|
||||
def _addtreeentry(
|
||||
self, dpack, hpack, nname, nnode, ntext, np1, np2, linknode, linkrev
|
||||
):
|
||||
# Not using deltas, since there aren't any other trees in
|
||||
# this pack it could delta against.
|
||||
dpack.add(nname, nnode, revlog.nullid, ntext)
|
||||
hpack.add(nname, nnode, np1, np2, linknode, "", linkrev=linkrev)
|
||||
|
||||
def _addtopack(
|
||||
self,
|
||||
ui,
|
||||
@ -765,10 +773,9 @@ class basetreemanifestlog(object):
|
||||
|
||||
node = overridenode
|
||||
for nname, nnode, ntext, np1text, np1, np2 in newtreeiter:
|
||||
# Not using deltas, since there aren't any other trees in
|
||||
# this pack it could delta against.
|
||||
dpack.add(nname, nnode, revlog.nullid, ntext)
|
||||
hpack.add(nname, nnode, np1, np2, linknode, "", linkrev=linkrev)
|
||||
self._addtreeentry(
|
||||
dpack, hpack, nname, nnode, ntext, np1, np2, linknode, linkrev
|
||||
)
|
||||
if node is None and nname == "":
|
||||
node = nnode
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user