From e939bb5de3b26d6a14bae2dfd4143e72645a89ca Mon Sep 17 00:00:00 2001 From: "nsylvain@google.com" Date: Wed, 1 Jun 2011 22:59:15 +0000 Subject: [PATCH] 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 --- gclient_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gclient_utils.py b/gclient_utils.py index 81a1f667e..1f4fdf22c 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -362,7 +362,8 @@ def MakeFileAnnotated(fileobj): 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 @@ def MakeFileAnnotated(fileobj): # 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