def __init__(self, app, embedded_extensions=False): self.app = app self.embedded_extensions = embedded_extensions self.repo = load_repo(self.app.config['REPO_PATH']) self.changectx = None self.content = [] app.blohg = self
def repo(self): if not os.path.isdir(self.app.config['REPO_PATH']): raise RuntimeError('Repository not found: %s' % \ self.app.config['REPO_PATH']) return load_repo(self.app.config['REPO_PATH'])
def test_no_backend(self): with self.assertRaises(RuntimeError): load_repo(self.repo_path)
def test_load_git_repository(self): GitRepository.create_repo(self.repo_path) repo = load_repo(self.repo_path) self.assertTrue(isinstance(repo, GitRepository))
def test_load_git_bare_repository(self): init_repository(self.repo_path, True) repo = load_repo(self.repo_path) self.assertTrue(isinstance(repo, GitRepository))
def test_load_hg_repository(self): HgRepository.create_repo(self.repo_path) repo = load_repo(self.repo_path) self.assertTrue(isinstance(repo, HgRepository))