Show More
@@ -119,7 +119,11 b' class InputStreamChunker(Thread):' | |||||
119 | kr = self.keep_reading |
|
119 | kr = self.keep_reading | |
120 | da = self.data_added |
|
120 | da = self.data_added | |
121 | go = self.go |
|
121 | go = self.go | |
|
122 | ||||
|
123 | try: | |||
122 | b = s.read(cs) |
|
124 | b = s.read(cs) | |
|
125 | except ValueError: | |||
|
126 | b = '' | |||
123 |
|
127 | |||
124 | while b and go.is_set(): |
|
128 | while b and go.is_set(): | |
125 | if len(t) > ccm: |
|
129 | if len(t) > ccm: | |
@@ -372,7 +376,9 b' class SubprocessIOChunker(object):' | |||||
372 | bg_out.stop() |
|
376 | bg_out.stop() | |
373 | bg_err.stop() |
|
377 | bg_err.stop() | |
374 | err = '%s' % ''.join(bg_err) |
|
378 | err = '%s' % ''.join(bg_err) | |
|
379 | if err: | |||
375 | raise EnvironmentError("Subprocess exited due to an error:\n" + err) |
|
380 | raise EnvironmentError("Subprocess exited due to an error:\n" + err) | |
|
381 | raise EnvironmentError("Subprocess exited with non 0 ret code:%s" % _returncode) | |||
376 |
|
382 | |||
377 | self.process = _p |
|
383 | self.process = _p | |
378 | self.output = bg_out |
|
384 | self.output = bg_out |
@@ -748,7 +748,8 b' def check_git_version():' | |||||
748 | from rhodecode.lib.vcs.backends.git.repository import GitRepository |
|
748 | from rhodecode.lib.vcs.backends.git.repository import GitRepository | |
749 | from distutils.version import StrictVersion |
|
749 | from distutils.version import StrictVersion | |
750 |
|
750 | |||
751 |
stdout, stderr = GitRepository._run_git_command('--version' |
|
751 | stdout, stderr = GitRepository._run_git_command('--version', _bare=True, | |
|
752 | _safe=True) | |||
752 |
|
753 | |||
753 | ver = (stdout.split(' ')[-1] or '').strip() or '0.0.0' |
|
754 | ver = (stdout.split(' ')[-1] or '').strip() or '0.0.0' | |
754 | if len(ver.split('.')) > 3: |
|
755 | if len(ver.split('.')) > 3: |
@@ -102,7 +102,17 b' class GitRepository(BaseRepository):' | |||||
102 | :param opts: env options to pass into Subprocess command |
|
102 | :param opts: env options to pass into Subprocess command | |
103 | """ |
|
103 | """ | |
104 |
|
104 | |||
|
105 | if '_bare' in opts: | |||
|
106 | _copts = [] | |||
|
107 | del opts['_bare'] | |||
|
108 | else: | |||
105 | _copts = ['-c', 'core.quotepath=false', ] |
|
109 | _copts = ['-c', 'core.quotepath=false', ] | |
|
110 | safe_call = False | |||
|
111 | if '_safe' in opts: | |||
|
112 | #no exc on failure | |||
|
113 | del opts['_safe'] | |||
|
114 | safe_call = True | |||
|
115 | ||||
106 | _str_cmd = False |
|
116 | _str_cmd = False | |
107 | if isinstance(cmd, basestring): |
|
117 | if isinstance(cmd, basestring): | |
108 | cmd = [cmd] |
|
118 | cmd = [cmd] | |
@@ -126,9 +136,13 b' class GitRepository(BaseRepository):' | |||||
126 | _opts.update(opts) |
|
136 | _opts.update(opts) | |
127 | p = subprocessio.SubprocessIOChunker(cmd, **_opts) |
|
137 | p = subprocessio.SubprocessIOChunker(cmd, **_opts) | |
128 | except (EnvironmentError, OSError), err: |
|
138 | except (EnvironmentError, OSError), err: | |
129 | log.error(traceback.format_exc()) |
|
139 | tb_err = ("Couldn't run git command (%s).\n" | |
130 | raise RepositoryError("Couldn't run git command (%s).\n" |
|
140 | "Original error was:%s\n" % (cmd, err)) | |
131 | "Original error was:%s" % (cmd, err)) |
|
141 | log.error(tb_err) | |
|
142 | if safe_call: | |||
|
143 | return '', err | |||
|
144 | else: | |||
|
145 | raise RepositoryError(tb_err) | |||
132 |
|
146 | |||
133 | return ''.join(p.output), ''.join(p.error) |
|
147 | return ''.join(p.output), ''.join(p.error) | |
134 |
|
148 |
General Comments 0
You need to be logged in to leave comments.
Login now