Fix a memory leak, from upstream. Bump revision.diff -r1.12 -r1.13 pkgsrc/devel/py-mercurial/Makefile
(joerg)
@@ -1,17 +1,18 @@ | @@ -1,17 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.12 2017/05/17 10:30:18 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.13 2017/07/25 16:09:40 joerg Exp $ | |
2 | 2 | |||
3 | DISTNAME= mercurial-${VERSION} | 3 | DISTNAME= mercurial-${VERSION} | |
4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | 4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= devel scm | 6 | CATEGORIES= devel scm | |
6 | MASTER_SITES= https://www.mercurial-scm.org/release/ | 7 | MASTER_SITES= https://www.mercurial-scm.org/release/ | |
7 | 8 | |||
8 | MAINTAINER= wiz@NetBSD.org | 9 | MAINTAINER= wiz@NetBSD.org | |
9 | HOMEPAGE= https://www.mercurial-scm.org/ | 10 | HOMEPAGE= https://www.mercurial-scm.org/ | |
10 | COMMENT= Fast, lightweight source control management system | 11 | COMMENT= Fast, lightweight source control management system | |
11 | LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer | 12 | LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer | |
12 | 13 | |||
13 | # with this dependency, two zip test cases start working | 14 | # with this dependency, two zip test cases start working | |
14 | # http://bz.selenic.com/show_bug.cgi?id=4483 | 15 | # http://bz.selenic.com/show_bug.cgi?id=4483 | |
15 | # http://bz.selenic.com/show_bug.cgi?id=4485 | 16 | # http://bz.selenic.com/show_bug.cgi?id=4485 | |
16 | #BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip | 17 | #BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip | |
17 | DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses | 18 | DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses |
@@ -1,6 +1,8 @@ | @@ -1,6 +1,8 @@ | |||
1 | $NetBSD: distinfo,v 1.50 2017/06/19 20:07:43 wiz Exp $ | 1 | $NetBSD: distinfo,v 1.51 2017/07/25 16:09:40 joerg Exp $ | |
2 | 2 | |||
3 | SHA1 (mercurial-4.2.1.tar.gz) = 3fb8e228c8e3129cae1b222085984f4f90c7140b | 3 | SHA1 (mercurial-4.2.1.tar.gz) = 3fb8e228c8e3129cae1b222085984f4f90c7140b | |
4 | RMD160 (mercurial-4.2.1.tar.gz) = a0dead4f0307fd168aa3a33aa9fd5971340eedc3 | 4 | RMD160 (mercurial-4.2.1.tar.gz) = a0dead4f0307fd168aa3a33aa9fd5971340eedc3 | |
5 | SHA512 (mercurial-4.2.1.tar.gz) = 0349fb5343210869bacb2247d30546676e5cf486f64fb8ebb2b1c6cdf7d564e7b754a43fb5b61c7d7e66a67609c514c8e15f415f4189bccbebb2fbb5a5474645 | 5 | SHA512 (mercurial-4.2.1.tar.gz) = 0349fb5343210869bacb2247d30546676e5cf486f64fb8ebb2b1c6cdf7d564e7b754a43fb5b61c7d7e66a67609c514c8e15f415f4189bccbebb2fbb5a5474645 | |
6 | Size (mercurial-4.2.1.tar.gz) = 5317692 bytes | 6 | Size (mercurial-4.2.1.tar.gz) = 5317692 bytes | |
7 | SHA1 (patch-mercurial_localrepo.py) = 2db659d4d5ee12c26a5dc78c87d5c30857cc3fb8 | |||
8 | SHA1 (patch-mercurial_statichttprepo.py) = a16b8eeae241cf0ecff310b6af70559b7a45daa2 |
$NetBSD: patch-mercurial_localrepo.py,v 1.1 2017/07/25 16:09:40 joerg Exp $
https://www.mercurial-scm.org/repo/hg/rev/7e89b
--- mercurial/localrepo.py.orig 2017-06-04 13:16:29.000000000 +0000
+++ mercurial/localrepo.py
@@ -382,6 +382,9 @@ class localrepository(object):
# - bookmark changes
self.filteredrevcache = {}
+ # Cache of types representing filtered repos.
+ self._filteredrepotypes = weakref.WeakKeyDictionary()
+
# generic mapping between names and nodes
self.names = namespaces.namespaces()
@@ -489,11 +492,21 @@ class localrepository(object):
def filtered(self, name):
"""Return a filtered version of a repository"""
- # build a new class with the mixin and the current class
- # (possibly subclass of the repo)
- class filteredrepo(repoview.repoview, self.unfiltered().__class__):
- pass
- return filteredrepo(self, name)
+ # Python <3.4 easily leaks types via __mro__. See
+ # https://bugs.python.org/issue17950. We cache dynamically
+ # created types so this method doesn't leak on every
+ # invocation.
+
+ key = self.unfiltered().__class__
+ if key not in self._filteredrepotypes:
+ # Build a new type with the repoview mixin and the base
+ # class of this repo. Give it a name containing the
+ # filter name to aid debugging.
+ bases = (repoview.repoview, key)
+ cls = type('%sfilteredrepo' % name, bases, {})
+ self._filteredrepotypes[key] = cls
+
+ return self._filteredrepotypes[key](self, name)
@repofilecache('bookmarks', 'bookmarks.current')
def _bookmarks(self):
$NetBSD: patch-mercurial_statichttprepo.py,v 1.1 2017/07/25 16:09:40 joerg Exp $
https://www.mercurial-scm.org/repo/hg/rev/7e89b
--- mercurial/statichttprepo.py.orig 2017-06-04 13:16:29.000000000 +0000
+++ mercurial/statichttprepo.py
@@ -164,6 +164,8 @@ class statichttprepository(localrepo.loc
self.encodepats = None
self.decodepats = None
self._transref = None
+ # Cache of types representing filtered repos.
+ self._filteredrepotypes = {}
def _restrictcapabilities(self, caps):
caps = super(statichttprepository, self)._restrictcapabilities(caps)