[PATCH 5 of 8] namespaces: add a convenience property for the weakref _repo

Sean Farley sean.michael.farley at gmail.com
Sun Dec 14 18:37:53 CST 2014


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1418602944 28800
#      Sun Dec 14 16:22:24 2014 -0800
# Node ID 6571c7c1c58e8f2eaac936b32d2195863c7b6ab9
# Parent  4d7a45c8487a63ac54971c4dbeddf2dac922a91f
namespaces: add a convenience property for the weakref _repo

diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py
--- a/mercurial/namespaces.py
+++ b/mercurial/namespaces.py
@@ -44,10 +44,14 @@ class namespaces(object):
 
     def __init__(self, repo):
         self._names = util.sortdict()
         self._repo = weakref.ref(repo)
 
+    @property
+    def repo(self):
+        return self._repo()
+
     def addnamespace(self, namespace, singular, names, namemap, nodemap,
                      order=None):
         """
         register a namespace
 


More information about the Mercurial-devel mailing list