Tue Jul 25 16:09:40 2017 UTC ()
Fix a memory leak, from upstream. Bump revision.


(joerg)
diff -r1.12 -r1.13 pkgsrc/devel/py-mercurial/Makefile
diff -r1.50 -r1.51 pkgsrc/devel/py-mercurial/distinfo
diff -r0 -r1.1 pkgsrc/devel/py-mercurial/patches/patch-mercurial_localrepo.py
diff -r0 -r1.1 pkgsrc/devel/py-mercurial/patches/patch-mercurial_statichttprepo.py

cvs diff -r1.12 -r1.13 pkgsrc/devel/py-mercurial/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/py-mercurial/Makefile 2017/05/17 10:30:18 1.12
+++ pkgsrc/devel/py-mercurial/Makefile 2017/07/25 16:09:40 1.13
@@ -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
3DISTNAME= mercurial-${VERSION} 3DISTNAME= mercurial-${VERSION}
4PKGNAME= ${PYPKGPREFIX}-${DISTNAME} 4PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
 5PKGREVISION= 1
5CATEGORIES= devel scm 6CATEGORIES= devel scm
6MASTER_SITES= https://www.mercurial-scm.org/release/ 7MASTER_SITES= https://www.mercurial-scm.org/release/
7 8
8MAINTAINER= wiz@NetBSD.org 9MAINTAINER= wiz@NetBSD.org
9HOMEPAGE= https://www.mercurial-scm.org/ 10HOMEPAGE= https://www.mercurial-scm.org/
10COMMENT= Fast, lightweight source control management system 11COMMENT= Fast, lightweight source control management system
11LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer 12LICENSE= 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
17DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses 18DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses

cvs diff -r1.50 -r1.51 pkgsrc/devel/py-mercurial/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/py-mercurial/distinfo 2017/06/19 20:07:43 1.50
+++ pkgsrc/devel/py-mercurial/distinfo 2017/07/25 16:09:40 1.51
@@ -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
3SHA1 (mercurial-4.2.1.tar.gz) = 3fb8e228c8e3129cae1b222085984f4f90c7140b 3SHA1 (mercurial-4.2.1.tar.gz) = 3fb8e228c8e3129cae1b222085984f4f90c7140b
4RMD160 (mercurial-4.2.1.tar.gz) = a0dead4f0307fd168aa3a33aa9fd5971340eedc3 4RMD160 (mercurial-4.2.1.tar.gz) = a0dead4f0307fd168aa3a33aa9fd5971340eedc3
5SHA512 (mercurial-4.2.1.tar.gz) = 0349fb5343210869bacb2247d30546676e5cf486f64fb8ebb2b1c6cdf7d564e7b754a43fb5b61c7d7e66a67609c514c8e15f415f4189bccbebb2fbb5a5474645 5SHA512 (mercurial-4.2.1.tar.gz) = 0349fb5343210869bacb2247d30546676e5cf486f64fb8ebb2b1c6cdf7d564e7b754a43fb5b61c7d7e66a67609c514c8e15f415f4189bccbebb2fbb5a5474645
6Size (mercurial-4.2.1.tar.gz) = 5317692 bytes 6Size (mercurial-4.2.1.tar.gz) = 5317692 bytes
 7SHA1 (patch-mercurial_localrepo.py) = 2db659d4d5ee12c26a5dc78c87d5c30857cc3fb8
 8SHA1 (patch-mercurial_statichttprepo.py) = a16b8eeae241cf0ecff310b6af70559b7a45daa2

File Added: pkgsrc/devel/py-mercurial/patches/Attic/patch-mercurial_localrepo.py
$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):

File Added: pkgsrc/devel/py-mercurial/patches/Attic/patch-mercurial_statichttprepo.py
$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)