##// 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 repocleartagscache = repocleartagscachefunc(repo)
495 repocleartagscache = repocleartagscachefunc(repo)
496 def t():
496 def t():
497 repo.changelog = mercurial.changelog.changelog(svfs)
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 repocleartagscache()
501 repocleartagscache()
500 return len(repo.tags())
502 return len(repo.tags())
501 timer(t)
503 timer(t)
@@ -364,14 +364,16 b' class bundlerepository(object):'
364 self.manstart = self._cgunpacker.tell()
364 self.manstart = self._cgunpacker.tell()
365 return c
365 return c
366
366
367 def _constructmanifest(self):
367 @localrepo.unfilteredpropertycache
368 def manifestlog(self):
368 self._cgunpacker.seek(self.manstart)
369 self._cgunpacker.seek(self.manstart)
369 # consume the header if it exists
370 # consume the header if it exists
370 self._cgunpacker.manifestheader()
371 self._cgunpacker.manifestheader()
371 linkmapper = self.unfiltered().changelog.rev
372 linkmapper = self.unfiltered().changelog.rev
372 m = bundlemanifest(self.svfs, self._cgunpacker, linkmapper)
373 rootstore = bundlemanifest(self.svfs, self._cgunpacker, linkmapper)
373 self.filestart = self._cgunpacker.tell()
374 self.filestart = self._cgunpacker.tell()
374 return m
375
376 return manifest.manifestlog(self.svfs, self, rootstore)
375
377
376 def _consumemanifest(self):
378 def _consumemanifest(self):
377 """Consumes the manifest portion of the bundle, setting filestart so the
379 """Consumes the manifest portion of the bundle, setting filestart so the
@@ -994,15 +994,10 b' class localrepository(object):'
994 return changelog.changelog(self.svfs,
994 return changelog.changelog(self.svfs,
995 trypending=txnutil.mayhavepending(self.root))
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 @storecache('00manifest.i')
997 @storecache('00manifest.i')
1004 def manifestlog(self):
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 @repofilecache('dirstate')
1002 @repofilecache('dirstate')
1008 def dirstate(self):
1003 def dirstate(self):
@@ -1609,7 +1609,7 b' class manifestlog(object):'
1609 of the list of files in the given commit. Consumers of the output of this
1609 of the list of files in the given commit. Consumers of the output of this
1610 class do not care about the implementation details of the actual manifests
1610 class do not care about the implementation details of the actual manifests
1611 they receive (i.e. tree or flat or lazily loaded, etc)."""
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 usetreemanifest = False
1613 usetreemanifest = False
1614 cachesize = 4
1614 cachesize = 4
1615
1615
@@ -1620,7 +1620,7 b' class manifestlog(object):'
1620
1620
1621 self._treemanifests = usetreemanifest
1621 self._treemanifests = usetreemanifest
1622
1622
1623 self._rootstore = repo._constructmanifest()
1623 self._rootstore = rootstore
1624 self._rootstore._setupmanifestcachehooks(repo)
1624 self._rootstore._setupmanifestcachehooks(repo)
1625 self._narrowmatch = repo.narrowmatch()
1625 self._narrowmatch = repo.narrowmatch()
1626
1626
@@ -185,7 +185,8 b' class statichttprepository(localrepo.loc'
185 self._filecache = {}
185 self._filecache = {}
186 self.requirements = requirements
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 self.changelog = changelog.changelog(self.svfs)
190 self.changelog = changelog.changelog(self.svfs)
190 self._tags = None
191 self._tags = None
191 self.nodetagscache = None
192 self.nodetagscache = None
@@ -208,6 +208,12 b' class unionrepository(object):'
208 def changelog(self):
208 def changelog(self):
209 return unionchangelog(self.svfs, self.repo2.svfs)
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 def _clrev(self, rev2):
217 def _clrev(self, rev2):
212 """map from repo2 changelog rev to temporary rev in self.changelog"""
218 """map from repo2 changelog rev to temporary rev in self.changelog"""
213 node = self.repo2.changelog.node(rev2)
219 node = self.repo2.changelog.node(rev2)
@@ -184,7 +184,7 b' def main():'
184 checkzobject(fl, allowextra=True)
184 checkzobject(fl, allowextra=True)
185
185
186 # Conforms to imanifestlog.
186 # Conforms to imanifestlog.
187 ml = manifest.manifestlog(vfs, repo)
187 ml = manifest.manifestlog(vfs, repo, manifest.manifestrevlog(repo.svfs))
188 checkzobject(ml)
188 checkzobject(ml)
189 checkzobject(repo.manifestlog)
189 checkzobject(repo.manifestlog)
190
190
General Comments 0
You need to be logged in to leave comments. Login now