namespaces: pass repo to __init__
We store repo as a weakref so that we can prevent a cycle between namespaces
and localrepo.
--- 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):
"""