diff -r f08f6a7d4d5f -r 7e1da5d004eb mercurial/namespaces.py --- a/mercurial/namespaces.py Sun Dec 14 15:04:40 2014 -0800 +++ b/mercurial/namespaces.py Sun Dec 14 15:35:57 2014 -0800 @@ -1,4 +1,5 @@ from mercurial import util +import weakref def tolist(val): """ @@ -30,8 +31,9 @@ _names_version = 0 - def __init__(self): + def __init__(self, repo): self._names = util.sortdict() + self._repo = weakref.ref(repo) def addnamespace(self, namespace, namemap, order=None): """