Mercurial > kallithea
changeset 3476:258e0353ca51 beta
CHanges to UI object injection after lazy property changes
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 06 Mar 2013 13:36:55 +0100 |
parents | f134d125fb67 |
children | 951aa2741c98 |
files | rhodecode/lib/vcs/backends/git/repository.py |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/git/repository.py Wed Mar 06 13:36:01 2013 +0100 +++ b/rhodecode/lib/vcs/backends/git/repository.py Wed Mar 06 13:36:55 2013 +0100 @@ -67,14 +67,12 @@ @ThreadLocalLazyProperty def _repo(self): repo = Repo(self.path) - #temporary set that to now at later we will move it to constructor - baseui = None - if baseui is None: + # patch the instance of GitRepo with an "FAKE" ui object to add + # compatibility layer with Mercurial + if not hasattr(repo, 'ui'): from mercurial.ui import ui baseui = ui() - # patch the instance of GitRepo with an "FAKE" ui object to add - # compatibility layer with Mercurial - setattr(repo, 'ui', baseui) + setattr(repo, 'ui', baseui) return repo @property