Commit d057f9af authored by szager@chromium.org's avatar szager@chromium.org

Explicitly print diff stats to sys.stdout, if possible.

This makes it possible to effectively re-route the stdout by
re-assigning sys.stdout.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@273595 0039d316-1c4b-4281-b951-d872f2087c98
parent f202a250
...@@ -259,10 +259,14 @@ def print_stats(similarity, find_copies, args): ...@@ -259,10 +259,14 @@ def print_stats(similarity, find_copies, args):
else: else:
similarity_options = ['-M%s' % similarity] similarity_options = ['-M%s' % similarity]
try:
stdout = sys.stdout.fileno()
except AttributeError:
stdout = None
return subprocess2.call( return subprocess2.call(
['git', ['git',
'diff', '--no-ext-diff', '--stat'] + similarity_options + args, 'diff', '--no-ext-diff', '--stat'] + similarity_options + args,
env=env) stdout=stdout, env=env)
class Settings(object): class Settings(object):
......
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