Show More
@@ -2,6 +2,7 b' import os' | |||
|
2 | 2 | import socket |
|
3 | 3 | import logging |
|
4 | 4 | import subprocess |
|
5 | import traceback | |
|
5 | 6 | |
|
6 | 7 | from webob import Request, Response, exc |
|
7 | 8 | |
@@ -90,7 +91,7 b' class GitRepository(object):' | |||
|
90 | 91 | ] |
|
91 | 92 | ) |
|
92 | 93 | except EnvironmentError, e: |
|
93 | log.exception(e) | |
|
94 | log.error(traceback.format_exc()) | |
|
94 | 95 | raise exc.HTTPExpectationFailed() |
|
95 | 96 | resp = Response() |
|
96 | 97 | resp.content_type = 'application/x-%s-advertisement' % str(git_command) |
@@ -126,23 +127,25 b' class GitRepository(object):' | |||
|
126 | 127 | env=gitenv, |
|
127 | 128 | cwd=os.getcwd() |
|
128 | 129 | ) |
|
129 | ||
|
130 | cmd = r'git %s --stateless-rpc "%s"' % (git_command[4:], | |
|
131 | self.content_path), | |
|
132 | log.debug('handling cmd %s' % cmd) | |
|
130 | 133 | out = subprocessio.SubprocessIOChunker( |
|
131 | r'git %s --stateless-rpc "%s"' % (git_command[4:], | |
|
132 | self.content_path), | |
|
134 | cmd, | |
|
133 | 135 | inputstream=inputstream, |
|
134 | 136 | **opts |
|
135 | 137 | ) |
|
136 | 138 | except EnvironmentError, e: |
|
137 | log.exception(e) | |
|
139 | log.error(traceback.format_exc()) | |
|
138 | 140 | raise exc.HTTPExpectationFailed() |
|
139 | 141 | |
|
140 | 142 | if git_command in [u'git-receive-pack']: |
|
141 | 143 | # updating refs manually after each push. |
|
142 | 144 | # Needed for pre-1.7.0.4 git clients using regular HTTP mode. |
|
143 |
|
|
|
144 |
|
|
|
145 | shell=True) | |
|
145 | cmd = (u'git --git-dir "%s" ' | |
|
146 | 'update-server-info' % self.content_path) | |
|
147 | log.debug('handling cmd %s' % cmd) | |
|
148 | subprocess.call(cmd, shell=True) | |
|
146 | 149 | |
|
147 | 150 | resp = Response() |
|
148 | 151 | resp.content_type = 'application/x-%s-result' % git_command.encode('utf8') |
@@ -161,9 +164,9 b' class GitRepository(object):' | |||
|
161 | 164 | resp = app(request, environ) |
|
162 | 165 | except exc.HTTPException, e: |
|
163 | 166 | resp = e |
|
164 | log.exception(e) | |
|
167 | log.error(traceback.format_exc()) | |
|
165 | 168 | except Exception, e: |
|
166 | log.exception(e) | |
|
169 | log.error(traceback.format_exc()) | |
|
167 | 170 | resp = exc.HTTPInternalServerError() |
|
168 | 171 | return resp(environ, start_response) |
|
169 | 172 |
General Comments 0
You need to be logged in to leave comments.
Login now