Changeset - 7b7afdbe57af
[Not reviewed]
Merge default
0 13 0
Mads Kiilerich (mads) - 5 years ago 2020-12-03 01:13:44
mads@kiilerich.com
Merge stable
10 files changed with 40 insertions and 19 deletions:
0 comments (0 inline, 0 general)
.hgtags
Show inline comments
 
@@ -79,3 +79,4 @@ aa0a637fa6f635a5e024fa56b19ed2a2dacca857
 
9f5ca9088067618d79129d224c35c818bd2d2f12 0.6.0
 
a22edac2be58eaf68d1940d4dfeb88fadbabb43a 0.6.1
 
22bfca5da6f56738f6220d24bb6ce2f9bc4f9b1e 0.6.2
 
213450cbdc11fff8508ba25101dc05ab74048e55 0.6.3
development.ini
Show inline comments
 
@@ -259,7 +259,7 @@ use_celery = false
 
## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
 
celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
 

	
 
celery.result.backend = db+sqlite:///celery-results.db
 
celery.result_backend = db+sqlite:///celery-results.db
 

	
 
#celery.amqp.task.result.expires = 18000
 

	
kallithea/controllers/admin/repo_groups.py
Show inline comments
 
@@ -117,7 +117,7 @@ class RepoGroupsController(BaseControlle
 
            children_groups = [g.name for g in repo_gr.parents] + [repo_gr.name]
 
            repo_count = repo_gr.repositories.count()
 
            repo_groups_data.append({
 
                "raw_name": repo_gr.group_name,
 
                "raw_name": webutils.escape(repo_gr.group_name),
 
                "group_name": repo_group_name(repo_gr.group_name, children_groups),
 
                "desc": webutils.escape(repo_gr.group_description),
 
                "repos": repo_count,
 
@@ -174,14 +174,14 @@ class RepoGroupsController(BaseControlle
 
        raise HTTPFound(location=url('repos_group_home', group_name=gr.group_name))
 

	
 
    def new(self):
 
        parent_group_id = safe_int(request.GET.get('parent_group') or '-1')
 
        if HasPermissionAny('hg.admin')('group create'):
 
            # we're global admin, we're ok and we can create TOP level groups
 
            pass
 
        else:
 
            # we pass in parent group into creation form, thus we know
 
            # what would be the group, we can check perms here !
 
            group_id = safe_int(request.GET.get('parent_group'))
 
            group = db.RepoGroup.get(group_id) if group_id else None
 
            group = db.RepoGroup.get(parent_group_id) if parent_group_id else None
 
            group_name = group.group_name if group else None
 
            if HasRepoGroupPermissionLevel('admin')(group_name, 'group create'):
 
                pass
 
@@ -189,7 +189,13 @@ class RepoGroupsController(BaseControlle
 
                raise HTTPForbidden()
 

	
 
        self.__load_defaults()
 
        return render('admin/repo_groups/repo_group_add.html')
 
        return htmlfill.render(
 
            render('admin/repo_groups/repo_group_add.html'),
 
            defaults={'parent_group_id': parent_group_id},
 
            errors={},
 
            prefix_error=False,
 
            encoding="UTF-8",
 
            force_defaults=False)
 

	
 
    @HasRepoGroupPermissionLevelDecorator('admin')
 
    def update(self, group_name):
kallithea/controllers/admin/repos.py
Show inline comments
 
@@ -144,7 +144,9 @@ class ReposController(BaseRepoController
 
            if prg is None or not any(rgc[0] == prg.group_id
 
                                      for rgc in c.repo_groups):
 
                raise HTTPForbidden
 
            defaults.update({'repo_group': parent_group})
 
        else:
 
            parent_group = '-1'
 
        defaults.update({'repo_group': parent_group})
 

	
 
        return htmlfill.render(
 
            render('admin/repos/repo_add.html'),
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -159,14 +159,26 @@ class GitRepository(BaseRepository):
 
        when the return code is non 200
 
        """
 
        # check first if it's not an local url
 
        if os.path.isdir(url) or url.startswith('file:'):
 
        if os.path.isabs(url) and os.path.isdir(url):
 
            return True
 

	
 
        if url.startswith('git://'):
 
            try:
 
                _git_colon, _empty, _host, path = url.split('/', 3)
 
            except ValueError:
 
                raise urllib.error.URLError("Invalid URL: %r" % url)
 
            # Mitigate problems elsewhere with incorrect handling of encoded paths.
 
            # Don't trust urllib.parse.unquote but be prepared for more flexible implementations elsewhere.
 
            # Space is the only allowed whitespace character - directly or % encoded. No other % or \ is allowed.
 
            for c in path.replace('%20', ' '):
 
                if c in '%\\':
 
                    raise urllib.error.URLError("Invalid escape character in path: '%s'" % c)
 
                if c.isspace() and c != ' ':
 
                    raise urllib.error.URLError("Invalid whitespace character in path: %r" % c)
 
            return True
 

	
 
        if '+' in url[:url.find('://')]:
 
            url = url[url.find('+') + 1:]
 
        if not url.startswith('http://') and not url.startswith('https://'):
 
            raise urllib.error.URLError("Unsupported protocol in URL %s" % url)
 

	
 
        url_obj = mercurial.util.url(safe_bytes(url))
 
        test_uri, handlers = get_urllib_request_handlers(url_obj)
kallithea/model/db.py
Show inline comments
 
@@ -1388,7 +1388,7 @@ class RepoGroup(meta.Base, BaseDbModel):
 
        """Return tuple with group_id and name as html literal"""
 
        if repo_group is None:
 
            return (-1, '-- %s --' % _('top level'))
 
        return repo_group.group_id, webutils.literal(cls.SEP.join(repo_group.full_path_splitted))
 
        return repo_group.group_id, webutils.literal(cls.SEP.join(webutils.html_escape(x) for x in repo_group.full_path_splitted))
 

	
 
    @classmethod
 
    def groups_choices(cls, groups):
kallithea/model/repo.py
Show inline comments
 
@@ -33,7 +33,7 @@ import traceback
 
from datetime import datetime
 

	
 
import kallithea.lib.utils2
 
from kallithea.lib import hooks
 
from kallithea.lib import hooks, webutils
 
from kallithea.lib.auth import HasRepoPermissionLevel, HasUserGroupPermissionLevel
 
from kallithea.lib.exceptions import AttachedForksError
 
from kallithea.lib.utils import is_valid_repo_uri, make_ui
 
@@ -156,18 +156,18 @@ class RepoModel(object):
 

	
 
        for gr in repo_groups_list or []:
 
            repos_data.append(dict(
 
                raw_name='\0' + gr.name, # sort before repositories
 
                just_name=gr.name,
 
                raw_name='\0' + webutils.html_escape(gr.name),  # sort before repositories
 
                just_name=webutils.html_escape(gr.name),
 
                name=_render('group_name_html', group_name=gr.group_name, name=gr.name),
 
                desc=gr.group_description))
 
                desc=desc(gr.group_description)))
 

	
 
        for repo in repos_list:
 
            if not HasRepoPermissionLevel('read')(repo.repo_name, 'get_repos_as_dict check'):
 
                continue
 
            cs_cache = repo.changeset_cache
 
            row = {
 
                "raw_name": repo.repo_name,
 
                "just_name": repo.just_name,
 
                "raw_name": webutils.html_escape(repo.repo_name),
 
                "just_name": webutils.html_escape(repo.just_name),
 
                "name": repo_lnk(repo.repo_name, repo.repo_type,
 
                                 repo.repo_state, repo.private, repo.fork),
 
                "following": following(
kallithea/templates/admin/repo_groups/repo_group_add.html
Show inline comments
 
@@ -41,7 +41,7 @@
 
            <div class="form-group">
 
                <label class="control-label" for="parent_group_id">${_('Group parent')}:</label>
 
                <div>
 
                    ${h.select('parent_group_id',request.GET.get('parent_group'),c.repo_groups,class_='form-control')}
 
                    ${h.select('parent_group_id',None,c.repo_groups,class_='form-control')}
 
                </div>
 
            </div>
 

	
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
@@ -27,7 +27,7 @@ ${h.form(url('repos'))}
 
        <div class="form-group">
 
            <label class="control-label" for="repo_group">${_('Repository group')}:</label>
 
            <div>
 
                ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_='form-control')}
 
                ${h.select('repo_group',None,c.repo_groups,class_='form-control')}
 
                <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
 
            </div>
 
        </div>
kallithea/templates/ini/template.ini.mako
Show inline comments
 
@@ -334,7 +334,7 @@ use_celery = false
 
<%text>##</%text> Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
 
celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
 

	
 
celery.result.backend = db+sqlite:///celery-results.db
 
celery.result_backend = db+sqlite:///celery-results.db
 

	
 
#celery.amqp.task.result.expires = 18000
 

	
0 comments (0 inline, 0 general)