##// END OF EJS Templates
localrepo: pass root manifest into manifestlog.__init__...
Gregory Szorc -
r39799:5ccd7913 default
parent child Browse files
Show More
@@ -495,7 +495,9 b' def perftags(ui, repo, **opts):'
495 495 repocleartagscache = repocleartagscachefunc(repo)
496 496 def t():
497 497 repo.changelog = mercurial.changelog.changelog(svfs)
498 repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo)
498 rootmanifest = mercurial.manifest.manifestrevlog(svfs)
499 repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo,
500 rootmanifest)
499 501 repocleartagscache()
500 502 return len(repo.tags())
501 503 timer(t)
@@ -364,14 +364,16 b' class bundlerepository(object):'
364 364 self.manstart = self._cgunpacker.tell()
365 365 return c
366 366
367 def _constructmanifest(self):
367 @localrepo.unfilteredpropertycache
368 def manifestlog(self):
368 369 self._cgunpacker.seek(self.manstart)
369 370 # consume the header if it exists
370 371 self._cgunpacker.manifestheader()
371 372 linkmapper = self.unfiltered().changelog.rev
372 m = bundlemanifest(self.svfs, self._cgunpacker, linkmapper)
373 rootstore = bundlemanifest(self.svfs, self._cgunpacker, linkmapper)
373 374 self.filestart = self._cgunpacker.tell()
374 return m
375
376 return manifest.manifestlog(self.svfs, self, rootstore)
375 377
376 378 def _consumemanifest(self):
377 379 """Consumes the manifest portion of the bundle, setting filestart so the
@@ -994,15 +994,10 b' class localrepository(object):'
994 994 return changelog.changelog(self.svfs,
995 995 trypending=txnutil.mayhavepending(self.root))
996 996
997 def _constructmanifest(self):
998 # This is a temporary function while we migrate from manifest to
999 # manifestlog. It allows bundlerepo and unionrepo to intercept the
1000 # manifest creation.
1001 return manifest.manifestrevlog(self.svfs)
1002
1003 997 @storecache('00manifest.i')
1004 998 def manifestlog(self):
1005 return manifest.manifestlog(self.svfs, self)
999 rootstore = manifest.manifestrevlog(self.svfs)
1000 return manifest.manifestlog(self.svfs, self, rootstore)
1006 1001
1007 1002 @repofilecache('dirstate')
1008 1003 def dirstate(self):
@@ -1609,7 +1609,7 b' class manifestlog(object):'
1609 1609 of the list of files in the given commit. Consumers of the output of this
1610 1610 class do not care about the implementation details of the actual manifests
1611 1611 they receive (i.e. tree or flat or lazily loaded, etc)."""
1612 def __init__(self, opener, repo):
1612 def __init__(self, opener, repo, rootstore):
1613 1613 usetreemanifest = False
1614 1614 cachesize = 4
1615 1615
@@ -1620,7 +1620,7 b' class manifestlog(object):'
1620 1620
1621 1621 self._treemanifests = usetreemanifest
1622 1622
1623 self._rootstore = repo._constructmanifest()
1623 self._rootstore = rootstore
1624 1624 self._rootstore._setupmanifestcachehooks(repo)
1625 1625 self._narrowmatch = repo.narrowmatch()
1626 1626
@@ -185,7 +185,8 b' class statichttprepository(localrepo.loc'
185 185 self._filecache = {}
186 186 self.requirements = requirements
187 187
188 self.manifestlog = manifest.manifestlog(self.svfs, self)
188 rootmanifest = manifest.manifestrevlog(self.svfs)
189 self.manifestlog = manifest.manifestlog(self.svfs, self, rootmanifest)
189 190 self.changelog = changelog.changelog(self.svfs)
190 191 self._tags = None
191 192 self.nodetagscache = None
@@ -208,6 +208,12 b' class unionrepository(object):'
208 208 def changelog(self):
209 209 return unionchangelog(self.svfs, self.repo2.svfs)
210 210
211 @localrepo.unfilteredpropertycache
212 def manifestlog(self):
213 rootstore = unionmanifest(self.svfs, self.repo2.svfs,
214 self.unfiltered()._clrev)
215 return manifest.manifestlog(self.svfs, self, rootstore)
216
211 217 def _clrev(self, rev2):
212 218 """map from repo2 changelog rev to temporary rev in self.changelog"""
213 219 node = self.repo2.changelog.node(rev2)
@@ -184,7 +184,7 b' def main():'
184 184 checkzobject(fl, allowextra=True)
185 185
186 186 # Conforms to imanifestlog.
187 ml = manifest.manifestlog(vfs, repo)
187 ml = manifest.manifestlog(vfs, repo, manifest.manifestrevlog(repo.svfs))
188 188 checkzobject(ml)
189 189 checkzobject(repo.manifestlog)
190 190
General Comments 0
You need to be logged in to leave comments. Login now