Show More
@@ -201,7 +201,7 b' class BaseVCSController(object):' | |||||
201 | from kallithea.lib.utils import get_repo_by_id |
|
201 | from kallithea.lib.utils import get_repo_by_id | |
202 | by_id_match = get_repo_by_id(repo_name) |
|
202 | by_id_match = get_repo_by_id(repo_name) | |
203 | if by_id_match: |
|
203 | if by_id_match: | |
204 | data[1] = by_id_match |
|
204 | data[1] = safe_str(by_id_match) | |
205 |
|
205 | |||
206 | return '/'.join(data) |
|
206 | return '/'.join(data) | |
207 |
|
207 |
@@ -84,7 +84,7 b' class SimpleHg(BaseVCSController):' | |||||
84 | #====================================================================== |
|
84 | #====================================================================== | |
85 | try: |
|
85 | try: | |
86 | str_repo_name = environ['REPO_NAME'] = self.__get_repository(environ) |
|
86 | str_repo_name = environ['REPO_NAME'] = self.__get_repository(environ) | |
87 | assert isinstance(str_repo_name, str) |
|
87 | assert isinstance(str_repo_name, str), str_repo_name | |
88 | repo_name = safe_unicode(str_repo_name) |
|
88 | repo_name = safe_unicode(str_repo_name) | |
89 | assert safe_str(repo_name) == str_repo_name, (str_repo_name, repo_name) |
|
89 | assert safe_str(repo_name) == str_repo_name, (str_repo_name, repo_name) | |
90 | log.debug('Extracted repo name is %s', repo_name) |
|
90 | log.debug('Extracted repo name is %s', repo_name) |
@@ -4,6 +4,8 b' import os' | |||||
4 | import mock |
|
4 | import mock | |
5 | import urllib |
|
5 | import urllib | |
6 |
|
6 | |||
|
7 | import pytest | |||
|
8 | ||||
7 | from kallithea.lib import vcs |
|
9 | from kallithea.lib import vcs | |
8 | from kallithea.model.db import Repository, RepoGroup, UserRepoToPerm, User,\ |
|
10 | from kallithea.model.db import Repository, RepoGroup, UserRepoToPerm, User,\ | |
9 | Permission |
|
11 | Permission | |
@@ -654,3 +656,8 b' class TestAdminReposControllerHG(TestCon' | |||||
654 | NEW_REPO = NEW_HG_REPO |
|
656 | NEW_REPO = NEW_HG_REPO | |
655 | OTHER_TYPE_REPO = GIT_REPO |
|
657 | OTHER_TYPE_REPO = GIT_REPO | |
656 | OTHER_TYPE = 'git' |
|
658 | OTHER_TYPE = 'git' | |
|
659 | ||||
|
660 | def test_permanent_url_protocol_access(self): | |||
|
661 | with pytest.raises(Exception) as e: | |||
|
662 | self.app.get(url('summary_home', repo_name='_1'), extra_environ={'HTTP_ACCEPT': 'application/mercurial'}) | |||
|
663 | assert 'Unable to detect pull/push action' in str(e) |
General Comments 0
You need to be logged in to leave comments.
Login now