Changeset - f68522e3df79
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-09-28 16:26:32
marcin@python-works.com
more logging in pygrack
1 file changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/middleware/pygrack.py
Show inline comments
 
@@ -2,6 +2,7 @@ import os
 
import socket
 
import logging
 
import subprocess
 
import traceback
 

	
 
from webob import Request, Response, exc
 

	
 
@@ -90,7 +91,7 @@ class GitRepository(object):
 
                ]
 
            )
 
        except EnvironmentError, e:
 
            log.exception(e)
 
            log.error(traceback.format_exc())
 
            raise exc.HTTPExpectationFailed()
 
        resp = Response()
 
        resp.content_type = 'application/x-%s-advertisement' % str(git_command)
 
@@ -126,23 +127,25 @@ class GitRepository(object):
 
                env=gitenv,
 
                cwd=os.getcwd()
 
            )
 

	
 
            cmd = r'git %s --stateless-rpc "%s"' % (git_command[4:],
 
                                                    self.content_path),
 
            log.debug('handling cmd %s' % cmd)
 
            out = subprocessio.SubprocessIOChunker(
 
                r'git %s --stateless-rpc "%s"' % (git_command[4:],
 
                                                  self.content_path),
 
                cmd,
 
                inputstream=inputstream,
 
                **opts
 
            )
 
        except EnvironmentError, e:
 
            log.exception(e)
 
            log.error(traceback.format_exc())
 
            raise exc.HTTPExpectationFailed()
 

	
 
        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.
 
            subprocess.call(u'git --git-dir "%s" '
 
                            'update-server-info' % self.content_path,
 
                            shell=True)
 
            cmd = (u'git --git-dir "%s" '
 
                    'update-server-info' % self.content_path)
 
            log.debug('handling cmd %s' % cmd)
 
            subprocess.call(cmd, shell=True)
 

	
 
        resp = Response()
 
        resp.content_type = 'application/x-%s-result' % git_command.encode('utf8')
 
@@ -161,9 +164,9 @@ class GitRepository(object):
 
            resp = app(request, environ)
 
        except exc.HTTPException, e:
 
            resp = e
 
            log.exception(e)
 
            log.error(traceback.format_exc())
 
        except Exception, e:
 
            log.exception(e)
 
            log.error(traceback.format_exc())
 
            resp = exc.HTTPInternalServerError()
 
        return resp(environ, start_response)
 

	
0 comments (0 inline, 0 general)