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

Side by Side Diff: scm.py

Issue 7888042: Replace check_output() call site into check_call(). Would throw otherwise. (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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 """Similar to upload.py's version but much simpler. 69 """Similar to upload.py's version but much simpler.
70 70
71 Returns 'svn', 'git' or None. 71 Returns 'svn', 'git' or None.
72 """ 72 """
73 if os.path.isdir(os.path.join(root, '.svn')): 73 if os.path.isdir(os.path.join(root, '.svn')):
74 return 'svn' 74 return 'svn'
75 elif os.path.isdir(os.path.join(root, '.git')): 75 elif os.path.isdir(os.path.join(root, '.git')):
76 return 'git' 76 return 'git'
77 else: 77 else:
78 try: 78 try:
79 subprocess2.check_output( 79 subprocess2.check_call(
80 ['git', 'rev-parse', '--show-cdup'], 80 ['git', 'rev-parse', '--show-cdup'],
81 stdout=subprocess2.VOID, 81 stdout=subprocess2.VOID,
82 stderr=subprocess2.VOID, 82 stderr=subprocess2.VOID,
83 cwd=root) 83 cwd=root)
84 return 'git' 84 return 'git'
85 except (OSError, subprocess2.CalledProcessError): 85 except (OSError, subprocess2.CalledProcessError):
86 return None 86 return None
87 87
88 88
89 class GIT(object): 89 class GIT(object):
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if (file_status[0][0] in ('D', 'A', '!') or 983 if (file_status[0][0] in ('D', 'A', '!') or
984 not file_status[0][1:].isspace()): 984 not file_status[0][1:].isspace()):
985 # Added, deleted file requires manual intervention and require calling 985 # Added, deleted file requires manual intervention and require calling
986 # revert, like for properties. 986 # revert, like for properties.
987 try: 987 try:
988 SVN.Capture(['revert', file_status[1]], cwd=repo_root) 988 SVN.Capture(['revert', file_status[1]], cwd=repo_root)
989 except subprocess2.CalledProcessError: 989 except subprocess2.CalledProcessError:
990 if not os.path.exists(file_path): 990 if not os.path.exists(file_path):
991 continue 991 continue
992 raise 992 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