diff mercurial/localrepo.py @ 37321:e826fe7a08c7

peer: make ui an attribute With abc interfaces, instance attributes could not satisfy @abc.abstractproperty requirements because interface conformance was tested at type creation time. When we created the abc peer interfaces, we had to make "ui" a @property to satisfy abc. Now that peer interfaces are using zope.interface and there is no import time validation (but there are tests validating instances conform to the interface), we can go back to using regular object attributes. Differential Revision: https://phab.mercurial-scm.org/D3069
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 30 Mar 2018 18:57:13 -0700
parents 836867586b83
children fdd22bf6398f
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Mar 30 18:53:17 2018 -0700
+++ b/mercurial/localrepo.py	Fri Mar 30 18:57:13 2018 -0700
@@ -162,15 +162,11 @@
         if caps is None:
             caps = moderncaps.copy()
         self._repo = repo.filtered('served')
-        self._ui = repo.ui
+        self.ui = repo.ui
         self._caps = repo._restrictcapabilities(caps)
 
     # Begin of _basepeer interface.
 
-    @util.propertycache
-    def ui(self):
-        return self._ui
-
     def url(self):
         return self._repo.url()