Changeset - 81ff11476d16
[Not reviewed]
default
0 4 0
Andrew Shadura - 9 years ago 2016-07-12 21:47:14
andrew@shadura.me
git: make sure repository path and name are Unicode strings

This is needed for supporting latest Dulwich version, but it also works with
out supported version.
4 files changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/hooks.py
Show inline comments
 
@@ -32,13 +32,13 @@ import binascii
 

	
 
from kallithea.lib.vcs.utils.hgcompat import nullrev, revrange
 
from kallithea.lib import helpers as h
 
from kallithea.lib.utils import action_logger
 
from kallithea.lib.vcs.backends.base import EmptyChangeset
 
from kallithea.lib.exceptions import HTTPLockedRC, UserCreationError
 
from kallithea.lib.utils2 import safe_str, _extract_extras
 
from kallithea.lib.utils2 import safe_str, safe_unicode, _extract_extras
 
from kallithea.model.db import Repository, User
 

	
 

	
 
def _get_scm_size(alias, root_path):
 

	
 
    if not alias.startswith('.'):
 
@@ -387,12 +387,13 @@ def handle_git_receive(repo_path, revs, 
 
    from kallithea.config.environment import load_environment
 
    from kallithea.model import init_model
 
    from kallithea.model.db import Ui
 
    from kallithea.lib.utils import make_ui
 
    extras = _extract_extras(env)
 

	
 
    repo_path = safe_unicode(repo_path)
 
    path, ini_name = os.path.split(extras['config'])
 
    conf = appconfig('config:%s' % ini_name, relative_to=path)
 
    load_environment(conf.global_conf, conf.local_conf, test_env=False,
 
                     test_index=False)
 

	
 
    engine = engine_from_config(conf, 'sqlalchemy.db1.')
kallithea/lib/middleware/pygrack.py
Show inline comments
 
@@ -31,12 +31,13 @@ import logging
 
import traceback
 

	
 
from webob import Request, Response, exc
 

	
 
import kallithea
 
from kallithea.lib.vcs import subprocessio
 
from kallithea.lib.utils2 import safe_unicode
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class FileWrapper(object):
 

	
 
@@ -83,12 +84,13 @@ class GitRepository(object):
 
    def _get_fixedpath(self, path):
 
        """
 
        Small fix for repo_path
 

	
 
        :param path:
 
        """
 
        path = safe_unicode(path)
 
        assert path.startswith('/' + self.repo_name + '/')
 
        return path[len(self.repo_name) + 2:].strip('/')
 

	
 
    def inforefs(self, request, environ):
 
        """
 
        WSGI Response producer for HTTP GET Git Smart
kallithea/lib/middleware/simplegit.py
Show inline comments
 
@@ -224,13 +224,13 @@ class SimpleGit(BaseVCSController):
 
        :param repo_path: full path to the repository
 
        """
 

	
 
        from kallithea.lib.middleware.pygrack import make_wsgi_app
 
        app = make_wsgi_app(
 
            repo_root=safe_str(self.basepath),
 
            repo_name=repo_name,
 
            repo_name=safe_unicode(repo_name),
 
            extras=extras,
 
        )
 
        return app
 

	
 
    def __get_repository(self, environ):
 
        """
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -55,13 +55,13 @@ class GitRepository(BaseRepository):
 
    DEFAULT_BRANCH_NAME = 'master'
 
    scm = 'git'
 

	
 
    def __init__(self, repo_path, create=False, src_url=None,
 
                 update_after_clone=False, bare=False):
 

	
 
        self.path = abspath(repo_path)
 
        self.path = safe_unicode(abspath(repo_path))
 
        repo = self._get_repo(create, src_url, update_after_clone, bare)
 
        self.bare = repo.bare
 

	
 
    @property
 
    def _config_files(self):
 
        return [
0 comments (0 inline, 0 general)