Patchwork [2,of,3] manifest: rename treemanifest load functions to ease debugging

login
register
mail settings
Submitter Augie Fackler
Date Sept. 28, 2015, 1:50 p.m.
Message ID <9dbfff2e6a26a42cd302.1443448216@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/10669/
State Accepted
Headers show

Comments

Augie Fackler - Sept. 28, 2015, 1:50 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1443215908 14400
#      Fri Sep 25 17:18:28 2015 -0400
# Node ID 9dbfff2e6a26a42cd3022b523aa27c358bacf5d8
# Parent  cb5276f84e12f2f3502edc8d9ba5ffbfae1c4ae9
manifest: rename treemanifest load functions to ease debugging

I'm hunting an infinite recursion bug at the moment, and having both
of these methods named just _load is muddying the waters slightly.

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -615,14 +615,14 @@  class treemanifest(object):
         copy = treemanifest(self._dir)
         copy._node = self._node
         copy._dirty = self._dirty
-        def _load():
+        def _load_for_copy():
             self._load()
             for d in self._dirs:
                 copy._dirs[d] = self._dirs[d].copy()
             copy._files = dict.copy(self._files)
             copy._flags = dict.copy(self._flags)
             copy._load = _noop
-        copy._load = _load
+        copy._load = _load_for_copy
         if self._load == _noop:
             # Chaining _load if it's _noop is functionally correct, but the
             # chain may end up excessively long (stack overflow), and
@@ -834,13 +834,13 @@  class treemanifest(object):
         return _text(sorted(dirs + files), usemanifestv2)
 
     def read(self, gettext, readsubtree):
-        def _load():
+        def _load_for_read():
             # Mark as loaded already here, so __setitem__ and setflag() don't
             # cause infinite loops when they try to load.
             self._load = _noop
             self.parse(gettext(), readsubtree)
             self._dirty = False
-        self._load = _load
+        self._load = _load_for_read
 
     def writesubtrees(self, m1, m2, writesubtree):
         self._load() # for consistency; should never have any effect here