Mercurial > hg-stable
changeset 30379:d79c141fdf41
manifest: remove usages of manifest.read
Now that the two manifestctx implementations have working read() functions,
let's remove the existing uses of manifest.read and drop the function.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 10 Nov 2016 02:13:19 -0800 |
parents | ed45283a0ca7 |
children | 10c924596e5c |
files | contrib/perf.py hgext/mq.py mercurial/manifest.py |
diffstat | 3 files changed, 2 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Thu Nov 10 02:13:19 2016 -0800 +++ b/contrib/perf.py Thu Nov 10 02:13:19 2016 -0800 @@ -567,7 +567,7 @@ t = ctx.manifestnode() def d(): repo.manifest.clearcaches() - repo.manifest.read(t) + repo.manifestlog[t].read() timer(d) fm.end()
--- a/hgext/mq.py Thu Nov 10 02:13:19 2016 -0800 +++ b/hgext/mq.py Thu Nov 10 02:13:19 2016 -0800 @@ -1660,7 +1660,7 @@ # caching against the next repo.status call mm, aa, dd = repo.status(patchparent, top)[:3] changes = repo.changelog.read(top) - man = repo.manifest.read(changes[0]) + man = repo.manifestlog[changes[0]].read() aaa = aa[:] matchfn = scmutil.match(repo[None], pats, opts) # in short mode, we only diff the files included in the
--- a/mercurial/manifest.py Thu Nov 10 02:13:19 2016 -0800 +++ b/mercurial/manifest.py Thu Nov 10 02:13:19 2016 -0800 @@ -1594,33 +1594,6 @@ self._dirlogcache) return self._dirlogcache[dir] - def read(self, node): - if node == revlog.nullid: - return self._newmanifest() # don't upset local cache - if node in self._mancache: - cached = self._mancache[node] - if (isinstance(cached, manifestctx) or - isinstance(cached, treemanifestctx)): - cached = cached.read() - return cached - if self._treeondisk: - def gettext(): - return self.revision(node) - def readsubtree(dir, subm): - return self.dirlog(dir).read(subm) - m = self._newmanifest() - m.read(gettext, readsubtree) - m.setnode(node) - arraytext = None - else: - text = self.revision(node) - m = self._newmanifest(text) - arraytext = array.array('c', text) - self._mancache[node] = m - if arraytext is not None: - self.fulltextcache[node] = arraytext - return m - def clearcaches(self): super(manifest, self).clearcaches() self._mancache.clear()