Remove empty lines from the output while using --jobs.
While using --jobs, empty lines are adding a lot of noise.
An example output would look like:
>gclient sync --jobs=10
1>
3>
4>
6>
5>
7>
5>
5>________ running 'git clone ...'
Review URL: http://codereview.chromium.org/7101012
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87542 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_utils.py b/gclient_utils.py
index 81a1f66..1f4fdf2 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -362,7 +362,8 @@
obj[0] += out
while '\n' in obj[0]:
line, remaining = obj[0].split('\n', 1)
- new_fileobj.old_annotated_write('%d>%s\n' % (index, line))
+ if line:
+ new_fileobj.old_annotated_write('%d>%s\n' % (index, line))
obj[0] = remaining
def full_flush():
@@ -383,7 +384,8 @@
# Don't keep the lock while writting. Will append \n when it shouldn't.
for orphan in orphans:
- new_fileobj.old_annotated_write('%d>%s\n' % (orphan[0], orphan[1]))
+ if orphan[1]:
+ new_fileobj.old_annotated_write('%d>%s\n' % (orphan[0], orphan[1]))
new_fileobj.write = annotated_write
new_fileobj.full_flush = full_flush