Mercurial > public > mercurial-scm > hg
comparison mercurial/namespaces.py @ 23557:b04b27aa6da3
namespaces: add a convenience property for the weakref _repo
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 14 Dec 2014 16:22:24 -0800 |
parents | 7e1da5d004eb |
children | 3198aac7a95d |
comparison
equal
deleted
inserted
replaced
23556:7e1da5d004eb | 23557:b04b27aa6da3 |
---|---|
33 | 33 |
34 def __init__(self, repo): | 34 def __init__(self, repo): |
35 self._names = util.sortdict() | 35 self._names = util.sortdict() |
36 self._repo = weakref.ref(repo) | 36 self._repo = weakref.ref(repo) |
37 | 37 |
38 @property | |
39 def repo(self): | |
40 return self._repo() | |
41 | |
38 def addnamespace(self, namespace, namemap, order=None): | 42 def addnamespace(self, namespace, namemap, order=None): |
39 """ | 43 """ |
40 register a namespace | 44 register a namespace |
41 | 45 |
42 namespace: the name to be registered (in plural form) | 46 namespace: the name to be registered (in plural form) |