diff --git a/rhodecode/lib/vcs/connection.py b/rhodecode/lib/vcs/connection.py --- a/rhodecode/lib/vcs/connection.py +++ b/rhodecode/lib/vcs/connection.py @@ -23,15 +23,23 @@ Holds connection for remote server. """ -def _not_initialized(*args, **kwargs): +class NotInitializedConnection(object): """Placeholder for objects which have to be initialized first.""" - raise Exception( - "rhodecode.lib.vcs is not yet initialized. " - "Make sure `vcs.server` is enabled in your configuration.") + + def _raise_exc(self): + raise Exception( + "rhodecode.lib.vcs is not yet initialized. " + "Make sure `vcs.server` is enabled in your configuration.") + + def __getattr__(self, item): + self._raise_exc() + + def __call__(self, *args, **kwargs): + self._raise_exc() # TODO: figure out a nice default value for these things -Service = _not_initialized +Service = NotInitializedConnection() -Git = _not_initialized -Hg = _not_initialized -Svn = _not_initialized +Git = NotInitializedConnection() +Hg = NotInitializedConnection() +Svn = NotInitializedConnection()