mercurial/namespaces.py
changeset 23556 7e1da5d004eb
parent 23555 f08f6a7d4d5f
child 23557 b04b27aa6da3
equal deleted inserted replaced
23555:f08f6a7d4d5f 23556:7e1da5d004eb
     1 from mercurial import util
     1 from mercurial import util
       
     2 import weakref
     2 
     3 
     3 def tolist(val):
     4 def tolist(val):
     4     """
     5     """
     5     a convenience method to return an empty list instead of None
     6     a convenience method to return an empty list instead of None
     6     """
     7     """
    28       'namemap': function that takes a name and returns a list of nodes
    29       'namemap': function that takes a name and returns a list of nodes
    29     """
    30     """
    30 
    31 
    31     _names_version = 0
    32     _names_version = 0
    32 
    33 
    33     def __init__(self):
    34     def __init__(self, repo):
    34         self._names = util.sortdict()
    35         self._names = util.sortdict()
       
    36         self._repo = weakref.ref(repo)
    35 
    37 
    36     def addnamespace(self, namespace, namemap, order=None):
    38     def addnamespace(self, namespace, namemap, order=None):
    37         """
    39         """
    38         register a namespace
    40         register a namespace
    39 
    41