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

Side by Side Diff: scm.py

Issue 7787008: SVN.GenerateDiff assumes SVN.Capture captures stderr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 months 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 | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """SCM-specific utility classes.""" 5 """SCM-specific utility classes."""
6 6
7 import cStringIO 7 import cStringIO
8 import glob 8 import glob
9 import logging 9 import logging
10 import os 10 import os
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 class SVN(object): 391 class SVN(object):
392 current_version = None 392 current_version = None
393 393
394 @staticmethod 394 @staticmethod
395 def Capture(args, **kwargs): 395 def Capture(args, **kwargs):
396 """Always redirect stderr. 396 """Always redirect stderr.
397 397
398 Throws an exception if non-0 is returned. 398 Throws an exception if non-0 is returned.
399 """ 399 """
400 return subprocess2.check_output(['svn'] + args, **kwargs) 400 return subprocess2.check_output(
401 ['svn'] + args, stderr=subprocess2.PIPE, **kwargs)
401 402
402 @staticmethod 403 @staticmethod
403 def RunAndGetFileList(verbose, args, cwd, file_list, stdout=None): 404 def RunAndGetFileList(verbose, args, cwd, file_list, stdout=None):
404 """Runs svn checkout, update, or status, output to stdout. 405 """Runs svn checkout, update, or status, output to stdout.
405 406
406 The first item in args must be either "checkout", "update", or "status". 407 The first item in args must be either "checkout", "update", or "status".
407 408
408 svn's stdout is parsed to collect a list of files checked out or updated. 409 svn's stdout is parsed to collect a list of files checked out or updated.
409 These files are appended to file_list. svn's stdout is also printed to 410 These files are appended to file_list. svn's stdout is also printed to
410 sys.stdout as in Run. 411 sys.stdout as in Run.
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 if (file_status[0][0] in ('D', 'A', '!') or 982 if (file_status[0][0] in ('D', 'A', '!') or
982 not file_status[0][1:].isspace()): 983 not file_status[0][1:].isspace()):
983 # Added, deleted file requires manual intervention and require calling 984 # Added, deleted file requires manual intervention and require calling
984 # revert, like for properties. 985 # revert, like for properties.
985 try: 986 try:
986 SVN.Capture(['revert', file_status[1]], cwd=repo_root) 987 SVN.Capture(['revert', file_status[1]], cwd=repo_root)
987 except subprocess2.CalledProcessError: 988 except subprocess2.CalledProcessError:
988 if not os.path.exists(file_path): 989 if not os.path.exists(file_path):
989 continue 990 continue
990 raise 991 raise
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698