Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 9097:431462bd8478
fix memory usage of revlog caches by limiting cache size [issue1639]
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 09 Jul 2009 17:10:07 -0500 |
parents | db3c1ab0e632 |
children | 71d26ae62fbb |
line wrap: on
line diff
--- a/mercurial/context.py Thu Jul 09 11:59:12 2009 +0200 +++ b/mercurial/context.py Thu Jul 09 17:10:07 2009 -0500 @@ -379,11 +379,11 @@ child[0][b1:b2] = parent[0][a1:a2] return child - getlog = util.cachefunc(lambda x: self._repo.file(x)) + getlog = util.lrucachefunc(lambda x: self._repo.file(x)) def getctx(path, fileid): log = path == self._path and self._filelog or getlog(path) return filectx(self._repo, path, fileid=fileid, filelog=log) - getctx = util.cachefunc(getctx) + getctx = util.lrucachefunc(getctx) def parents(f): # we want to reuse filectx objects as much as possible