Mercurial > kallithea
diff rhodecode/lib/middleware/pygrack.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
This imports changes between changesets 21af6c4eab3d and 6177597791c2 in
RhodeCode's original repository, including only changes to Python files and HTML.
RhodeCode clearly licensed its changes to these files under GPLv3
in their /LICENSE file, which states the following:
The Python code and integrated HTML are licensed under the GPLv3 license.
(See:
https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE
or
http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE
for an online copy of that LICENSE file)
Conservancy reviewed these changes and confirmed that they can be licensed as
a whole to the Kallithea project under GPLv3-only.
While some of the contents committed herein are clearly licensed
GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the
statement above from RhodeCode indicates that they intend GPLv3-only as their
license, per GPLv3ยง14 and other relevant sections of GPLv3.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 02 Jul 2014 19:03:13 -0400 |
parents | dc4644865e8b |
children | 7e5f8c12a3fc |
line wrap: on
line diff
--- a/rhodecode/lib/middleware/pygrack.py Wed Jul 02 19:03:10 2014 -0400 +++ b/rhodecode/lib/middleware/pygrack.py Wed Jul 02 19:03:13 2014 -0400 @@ -1,7 +1,6 @@ import os import socket import logging -import subprocess import traceback from webob import Request, Response, exc @@ -86,7 +85,7 @@ try: out = subprocessio.SubprocessIOChunker( r'%s %s --stateless-rpc --advertise-refs "%s"' % ( - _git_path, git_command[4:], self.content_path), + _git_path, git_command[4:], self.content_path), starting_values=[ packet_len + server_advert + '0000' ] @@ -107,6 +106,7 @@ returns an iterator obj with contents of git command's response to stdout """ + _git_path = rhodecode.CONFIG.get('git_path', 'git') git_command = self._get_fixedpath(request.path_info) if git_command not in self.commands: log.debug('command %s not allowed' % git_command) @@ -124,10 +124,10 @@ gitenv['GIT_CONFIG_NOGLOBAL'] = '1' opts = dict( env=gitenv, - cwd=os.getcwd() + cwd=self.content_path, ) - cmd = r'git %s --stateless-rpc "%s"' % (git_command[4:], - self.content_path), + cmd = r'%s %s --stateless-rpc "%s"' % (_git_path, git_command[4:], + self.content_path), log.debug('handling cmd %s' % cmd) out = subprocessio.SubprocessIOChunker( cmd, @@ -141,11 +141,11 @@ if git_command in [u'git-receive-pack']: # updating refs manually after each push. # Needed for pre-1.7.0.4 git clients using regular HTTP mode. - _git_path = rhodecode.CONFIG.get('git_path', 'git') - cmd = (u'%s --git-dir "%s" ' - 'update-server-info' % (_git_path, self.content_path)) - log.debug('handling cmd %s' % cmd) - subprocess.call(cmd, shell=True) + from rhodecode.lib.vcs import get_repo + from dulwich.server import update_server_info + repo = get_repo(self.content_path) + if repo: + update_server_info(repo._repo) resp = Response() resp.content_type = 'application/x-%s-result' % git_command.encode('utf8') @@ -197,4 +197,6 @@ def make_wsgi_app(repo_name, repo_root, extras): - return GitDirectory(repo_root, repo_name, extras) + from dulwich.web import LimitedInputFilter, GunzipFilter + app = GitDirectory(repo_root, repo_name, extras) + return GunzipFilter(LimitedInputFilter(app))