# HG changeset patch # User Augie Fackler # Date 1518462104 18000 # Node ID 59adb3051718ad699965943f2fa95e77c8f9896c # Parent 142ce66a41185828e3c249cc8bf7b4491c709e28 manifest: clean up dirlog() to take a d parameter to avoid shadowing dir() Differential Revision: https://phab.mercurial-scm.org/D2187 diff -r 142ce66a4118 -r 59adb3051718 hgext/narrow/narrowrevlog.py --- a/hgext/narrow/narrowrevlog.py Mon Feb 12 14:00:02 2018 -0500 +++ b/hgext/narrow/narrowrevlog.py Mon Feb 12 14:01:44 2018 -0500 @@ -116,12 +116,12 @@ # This function is called via debug{revlog,index,data}, but also during # at least some push operations. This will be used to wrap/exclude the # child directories when using treemanifests. - def dirlog(self, dir): - if dir and not dir.endswith('/'): - dir = dir + '/' - if not repo.narrowmatch().visitdir(dir[:-1] or '.'): - return excludedmanifestrevlog(dir) - result = super(narrowmanifestrevlog, self).dirlog(dir) + def dirlog(self, d): + if d and not d.endswith('/'): + d = d + '/' + if not repo.narrowmatch().visitdir(d[:-1] or '.'): + return excludedmanifestrevlog(d) + result = super(narrowmanifestrevlog, self).dirlog(d) makenarrowmanifestrevlog(result, repo) return result diff -r 142ce66a4118 -r 59adb3051718 mercurial/manifest.py --- a/mercurial/manifest.py Mon Feb 12 14:00:02 2018 -0500 +++ b/mercurial/manifest.py Mon Feb 12 14:01:44 2018 -0500 @@ -1245,15 +1245,15 @@ self._fulltextcache.clear() self._dirlogcache = {'': self} - def dirlog(self, dir): - if dir: + def dirlog(self, d): + if d: assert self._treeondisk - if dir not in self._dirlogcache: - mfrevlog = manifestrevlog(self.opener, dir, + if d not in self._dirlogcache: + mfrevlog = manifestrevlog(self.opener, d, self._dirlogcache, treemanifest=self._treeondisk) - self._dirlogcache[dir] = mfrevlog - return self._dirlogcache[dir] + self._dirlogcache[d] = mfrevlog + return self._dirlogcache[d] def add(self, m, transaction, link, p1, p2, added, removed, readtree=None): if (p1 in self.fulltextcache and util.safehasattr(m, 'fastdelta')