Changeset - 8cf1d694bda0
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-09-24 14:24:40
madski@unity3d.com
vcs: introduce hack for handling git failure on --depth cloning (Issue #33)
1 file changed with 12 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/subprocessio.py
Show inline comments
 
@@ -375,14 +375,20 @@ class SubprocessIOChunker(object):
 
            except Exception:
 
                pass
 
            bg_out.stop()
 
            out = ''.join(bg_out)
 
            bg_err.stop()
 
            err = '%s' % ''.join(bg_err)
 
            if err:
 
            err = ''.join(bg_err)
 
            if (err.strip() == 'fatal: The remote end hung up unexpectedly' and
 
                out.startswith('0034shallow ')):
 
                # hack inspired by https://github.com/schacon/grack/pull/7
 
                bg_out = iter([out])
 
                _p = None
 
            elif err:
 
                raise EnvironmentError(
 
                    "Subprocess exited due to an error:\n" + err)
 
            raise EnvironmentError(
 
                "Subprocess exited with non 0 ret code:%s" % _returncode)
 

	
 
            else:
 
                raise EnvironmentError(
 
                    "Subprocess exited with non 0 ret code:%s" % _returncode)
 
        self.process = _p
 
        self.output = bg_out
 
        self.error = bg_err
 
@@ -392,7 +398,7 @@ class SubprocessIOChunker(object):
 
        return self
 

	
 
    def next(self):
 
        if self.process.poll():
 
        if self.process and self.process.poll():
 
            err = '%s' % ''.join(self.error)
 
            raise EnvironmentError("Subprocess exited due to an error:\n" + err)
 
        return self.output.next()
0 comments (0 inline, 0 general)