@@ -31,13 +31,13 @@ def make_map(config):
"""
from rhodecode.model.db import Repository
repo_name = match_dict.get('repo_name')
try:
by_id = repo_name.split('_')
if len(by_id) == 2 and by_id[1].isdigit():
if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '':
repo_name = Repository.get(by_id[1]).repo_name
match_dict['repo_name'] = repo_name
except:
pass
return is_valid_repo(repo_name, config['base_path'])
from rhodecode.tests import *
from rhodecode.lib.utils import invalidate_cache
from rhodecode.model.repo import RepoModel
from rhodecode.tests.models.common import _make_repo
from rhodecode.model.meta import Session
class TestSummaryController(TestController):
def test_index(self):
self.log_user()
@@ -79,12 +82,26 @@ class TestSummaryController(TestControll
"""title="Mercurial repository" alt="Mercurial """
"""repository" src="/images/icons/hgicon.png"/>""")
response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
"""title="public repository" alt="public """
"""repository" src="/images/icons/lock_open.png"/>""")
def test_index_by_repo_having_id_path_in_name_hg(self):
_make_repo(name='repo_1')
Session().commit()
response = self.app.get(url(controller='summary',
action='index',
repo_name='repo_1'))
response.mustcontain("""repo_1""")
finally:
RepoModel().delete(Repository.get_by_repo_name('repo_1'))
def test_index_by_id_git(self):
ID = Repository.get_by_repo_name(GIT_REPO).repo_id
repo_name='_%s' % ID))
Status change: