Commits

Yuya Nishihara committed ae815dc

thgrepo: do not clear cache of changectx wrapper class

Since hg 0537c0cfd87c, "ctx1 == ctx2" checks the equality of the object type,
so recreating wrapper class is invalid and causes random failure.

fdf536d985c4 set the cache limit in case bad extension creates changectx
wrapper for each object as we did, but it's invalid anyway, we don't need
to care about it.

  • Participants
  • Parent commits f160742
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/thgrepo.py

 
     return thgrepository
 
-_maxchangectxclscache = 10
 _changectxclscache = {}  # parentcls: extendedcls
 
 def _extendchangectx(changectx):
         pass
 
     assert parentcls not in _changectxclscache.values(), 'double thgchangectx'
-
-    # in case each changectx instance is wrapped by some extension, there's
-    # limit on cache size. it may be possible to use weakref.WeakKeyDictionary
-    # on Python 2.5 or later.
-    if len(_changectxclscache) >= _maxchangectxclscache:
-        _changectxclscache.clear()
     _changectxclscache[parentcls] = cls = _createchangectxcls(parentcls)
     return cls