# HG changeset patch # User Sean Farley # Date 1418600157 28800 # Node ID 7e1da5d004ebeaf7cce08883d3b6deaf10a0d725 # Parent f08f6a7d4d5fba107a0540138c55d49f85d2d60f namespaces: pass repo to __init__ We store repo as a weakref so that we can prevent a cycle between namespaces and localrepo. 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): """