Commit 43f4ecc6 authored by iannucci@chromium.org's avatar iannucci@chromium.org

Make git rebase-update more responsive.

Passes through git-fetch's output instead of buffering it.

R=djacques@chromium.org
TBR=agable@chromium.org
BUG=366375

Review URL: https://codereview.chromium.org/264423002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269080 0039d316-1c4b-4281-b951-d872f2087c98
parent 5c7e5b31
......@@ -64,10 +64,8 @@ def fetch_remotes(branch_tree):
if not fetch_args: # pragma: no cover
print 'Nothing to fetch.'
else:
out, err = git.run_with_stderr('fetch', *fetch_args)
for data, stream in zip((out, err), (sys.stdout, sys.stderr)):
if data:
print >> stream, data
git.run_with_stderr('fetch', *fetch_args, stdout=sys.stdout,
stderr=sys.stderr)
def remove_empty_branches(branch_tree):
......
......@@ -14,8 +14,6 @@ import sys
import tempfile
import unittest
from cStringIO import StringIO
def git_hash_data(data, typ='blob'):
"""Calculate the git-style SHA1 for some data.
......@@ -395,13 +393,17 @@ class GitRepo(object):
stdout = sys.stdout
stderr = sys.stderr
try:
sys.stdout = StringIO()
sys.stderr = StringIO()
try:
self.run(fn, *args, **kwargs)
except SystemExit:
pass
return sys.stdout.getvalue(), sys.stderr.getvalue()
# "multiple statements on a line" pylint: disable=C0321
with tempfile.TemporaryFile() as out, tempfile.TemporaryFile() as err:
sys.stdout = out
sys.stderr = err
try:
self.run(fn, *args, **kwargs)
except SystemExit:
pass
out.seek(0)
err.seek(0)
return out.read(), err.read()
finally:
sys.stdout = stdout
sys.stderr = stderr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment