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
experimental/szager/collated-output
nsylvain@google.com 14 years ago
parent 328c3c73a8
commit e939bb5de3

@ -362,7 +362,8 @@ def MakeFileAnnotated(fileobj):
obj[0] += out obj[0] += out
while '\n' in obj[0]: while '\n' in obj[0]:
line, remaining = obj[0].split('\n', 1) 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 obj[0] = remaining
def full_flush(): def full_flush():
@ -383,7 +384,8 @@ def MakeFileAnnotated(fileobj):
# Don't keep the lock while writting. Will append \n when it shouldn't. # Don't keep the lock while writting. Will append \n when it shouldn't.
for orphan in orphans: 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.write = annotated_write
new_fileobj.full_flush = full_flush new_fileobj.full_flush = full_flush

Loading…
Cancel
Save