diff options
author | joerg <joerg@pkgsrc.org> | 2017-07-25 16:09:40 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2017-07-25 16:09:40 +0000 |
commit | f8482e8b19a3f23a03c2ebc6db8bbeab016c66a7 (patch) | |
tree | 7c2e97eb03a7b72069e4f5aef87cb15445bf3d88 | |
parent | e1ce3d2b80257831a293e1fe7f8c5e149786ca1f (diff) | |
download | pkgsrc-f8482e8b19a3f23a03c2ebc6db8bbeab016c66a7.tar.gz |
Fix a memory leak, from upstream. Bump revision.
-rw-r--r-- | devel/py-mercurial/Makefile | 3 | ||||
-rw-r--r-- | devel/py-mercurial/distinfo | 4 | ||||
-rw-r--r-- | devel/py-mercurial/patches/patch-mercurial_localrepo.py | 43 | ||||
-rw-r--r-- | devel/py-mercurial/patches/patch-mercurial_statichttprepo.py | 15 |
4 files changed, 63 insertions, 2 deletions
diff --git a/devel/py-mercurial/Makefile b/devel/py-mercurial/Makefile index f4e00865530..9db094c86b4 100644 --- a/devel/py-mercurial/Makefile +++ b/devel/py-mercurial/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.12 2017/05/17 10:30:18 wiz Exp $ +# $NetBSD: Makefile,v 1.13 2017/07/25 16:09:40 joerg Exp $ DISTNAME= mercurial-${VERSION} PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +PKGREVISION= 1 CATEGORIES= devel scm MASTER_SITES= https://www.mercurial-scm.org/release/ diff --git a/devel/py-mercurial/distinfo b/devel/py-mercurial/distinfo index 40f3a3969bb..bb9372e4963 100644 --- a/devel/py-mercurial/distinfo +++ b/devel/py-mercurial/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.50 2017/06/19 20:07:43 wiz Exp $ +$NetBSD: distinfo,v 1.51 2017/07/25 16:09:40 joerg Exp $ SHA1 (mercurial-4.2.1.tar.gz) = 3fb8e228c8e3129cae1b222085984f4f90c7140b RMD160 (mercurial-4.2.1.tar.gz) = a0dead4f0307fd168aa3a33aa9fd5971340eedc3 SHA512 (mercurial-4.2.1.tar.gz) = 0349fb5343210869bacb2247d30546676e5cf486f64fb8ebb2b1c6cdf7d564e7b754a43fb5b61c7d7e66a67609c514c8e15f415f4189bccbebb2fbb5a5474645 Size (mercurial-4.2.1.tar.gz) = 5317692 bytes +SHA1 (patch-mercurial_localrepo.py) = 2db659d4d5ee12c26a5dc78c87d5c30857cc3fb8 +SHA1 (patch-mercurial_statichttprepo.py) = a16b8eeae241cf0ecff310b6af70559b7a45daa2 diff --git a/devel/py-mercurial/patches/patch-mercurial_localrepo.py b/devel/py-mercurial/patches/patch-mercurial_localrepo.py new file mode 100644 index 00000000000..43f2fec68e5 --- /dev/null +++ b/devel/py-mercurial/patches/patch-mercurial_localrepo.py @@ -0,0 +1,43 @@ +$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): diff --git a/devel/py-mercurial/patches/patch-mercurial_statichttprepo.py b/devel/py-mercurial/patches/patch-mercurial_statichttprepo.py new file mode 100644 index 00000000000..485a82eca76 --- /dev/null +++ b/devel/py-mercurial/patches/patch-mercurial_statichttprepo.py @@ -0,0 +1,15 @@ +$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) |