D2187: manifest: clean up dirlog() to take a d parameter to avoid shadowing dir()

2018-02-12 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG59adb3051718: manifest: clean up dirlog() to take a d 
parameter to avoid shadowing dir() (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2187?vs=5517=5557

REVISION DETAIL
  https://phab.mercurial-scm.org/D2187

AFFECTED FILES
  hgext/narrow/narrowrevlog.py
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -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')
diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -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
 



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2187: manifest: clean up dirlog() to take a d parameter to avoid shadowing dir()

2018-02-12 Thread durin42 (Augie Fackler)
durin42 updated this revision to Diff 5517.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2187?vs=5503=5517

REVISION DETAIL
  https://phab.mercurial-scm.org/D2187

AFFECTED FILES
  hgext/narrow/narrowrevlog.py
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -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')
diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -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
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2187: manifest: clean up dirlog() to take a d parameter to avoid shadowing dir()

2018-02-12 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2187

AFFECTED FILES
  hgext/narrow/narrowrevlog.py
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -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')
diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -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
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel