Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: gclient_utils.py

Issue 344004: Make 'gclient update' and 'gclient status' quieter by default - they don't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gclient_scm.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2009 Google Inc. All Rights Reserved. 1 # Copyright 2009 Google Inc. All Rights Reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 shell=(sys.platform == 'win32'), stdout=subprocess.PIPE) 207 shell=(sys.platform == 'win32'), stdout=subprocess.PIPE)
208 208
209 # Also, we need to forward stdout to prevent weird re-ordering of output. 209 # Also, we need to forward stdout to prevent weird re-ordering of output.
210 # This has to be done on a per byte basis to make sure it is not buffered: 210 # This has to be done on a per byte basis to make sure it is not buffered:
211 # normally buffering is done for each line, but if svn requests input, no 211 # normally buffering is done for each line, but if svn requests input, no
212 # end-of-line character is output after the prompt and it would not show up. 212 # end-of-line character is output after the prompt and it would not show up.
213 in_byte = kid.stdout.read(1) 213 in_byte = kid.stdout.read(1)
214 in_line = "" 214 in_line = ""
215 while in_byte: 215 while in_byte:
216 if in_byte != "\r": 216 if in_byte != "\r":
217 if not print_messages:
M-A Ruel 2009/10/27 23:31:13 Move this inside the print_stdout. You don't want
Dirk Pranke 2009/10/27 23:44:30 Are you sure? In the old version we would've print
218 print("\n________ running \'%s\' in \'%s\'"
219 % (' '.join(command), in_directory))
220 print_messages = True
217 if print_stdout: 221 if print_stdout:
218 sys.stdout.write(in_byte) 222 sys.stdout.write(in_byte)
219 if in_byte != "\n": 223 if in_byte != "\n":
220 in_line += in_byte 224 in_line += in_byte
221 if in_byte == "\n" and filter: 225 if in_byte == "\n" and filter:
222 filter(in_line) 226 filter(in_line)
223 in_line = "" 227 in_line = ""
224 in_byte = kid.stdout.read(1) 228 in_byte = kid.stdout.read(1)
225 rv = kid.wait() 229 rv = kid.wait()
226 230
227 if rv: 231 if rv:
228 msg = "failed to run command: %s" % " ".join(command) 232 msg = "failed to run command: %s" % " ".join(command)
229 233
230 if fail_status != None: 234 if fail_status != None:
231 print >>sys.stderr, msg 235 print >>sys.stderr, msg
232 sys.exit(fail_status) 236 sys.exit(fail_status)
233 237
234 raise Error(msg) 238 raise Error(msg)
235 239
236 240
237 def IsUsingGit(root, paths): 241 def IsUsingGit(root, paths):
238 """Returns True if we're using git to manage any of our checkouts. 242 """Returns True if we're using git to manage any of our checkouts.
239 |entries| is a list of paths to check.""" 243 |entries| is a list of paths to check."""
240 for path in paths: 244 for path in paths:
241 if os.path.exists(os.path.join(root, path, '.git')): 245 if os.path.exists(os.path.join(root, path, '.git')):
242 return True 246 return True
243 return False 247 return False
OLDNEW
« no previous file with comments | « gclient_scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698