# HG changeset patch # User Marcin Kuzminski # Date 2013-03-06 13:36:55 # Node ID 258e0353ca51450a06833aaa6da9b45999e523c5 # Parent f134d125fb6789ded69d5bcafbf53167203333e0 CHanges to UI object injection after lazy property changes diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -67,14 +67,12 @@ class GitRepository(BaseRepository): @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