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

Side by Side Diff: scm.py

Issue 8937010: Fix a regression introduced in r114262, cwd must be a named argument to subprocess2.Popen(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 # 1) iterate through our branch history and find the svn URL. 219 # 1) iterate through our branch history and find the svn URL.
220 # 2) find the svn-remote that fetches from the URL. 220 # 2) find the svn-remote that fetches from the URL.
221 221
222 # regexp matching the git-svn line that contains the URL. 222 # regexp matching the git-svn line that contains the URL.
223 git_svn_re = re.compile(r'^\s*git-svn-id: (\S+)@', re.MULTILINE) 223 git_svn_re = re.compile(r'^\s*git-svn-id: (\S+)@', re.MULTILINE)
224 224
225 # We don't want to go through all of history, so read a line from the 225 # We don't want to go through all of history, so read a line from the
226 # pipe at a time. 226 # pipe at a time.
227 # The -100 is an arbitrary limit so we don't search forever. 227 # The -100 is an arbitrary limit so we don't search forever.
228 cmd = ['git', 'log', '-100', '--pretty=medium'] 228 cmd = ['git', 'log', '-100', '--pretty=medium']
229 proc = subprocess2.Popen(cmd, cwd, stdout=subprocess2.PIPE) 229 proc = subprocess2.Popen(cmd, cwd=cwd, stdout=subprocess2.PIPE)
230 url = None 230 url = None
231 for line in proc.stdout: 231 for line in proc.stdout:
232 match = git_svn_re.match(line) 232 match = git_svn_re.match(line)
233 if match: 233 if match:
234 url = match.group(1) 234 url = match.group(1)
235 proc.stdout.close() # Cut pipe. 235 proc.stdout.close() # Cut pipe.
236 break 236 break
237 237
238 if url: 238 if url:
239 svn_remote_re = re.compile(r'^svn-remote\.([^.]+)\.url (.*)$') 239 svn_remote_re = re.compile(r'^svn-remote\.([^.]+)\.url (.*)$')
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 # revert, like for properties. 1004 # revert, like for properties.
1005 if not os.path.isdir(cwd): 1005 if not os.path.isdir(cwd):
1006 # '.' was deleted. It's not worth continuing. 1006 # '.' was deleted. It's not worth continuing.
1007 return 1007 return
1008 try: 1008 try:
1009 SVN.Capture(['revert', file_status[1]], cwd=cwd) 1009 SVN.Capture(['revert', file_status[1]], cwd=cwd)
1010 except subprocess2.CalledProcessError: 1010 except subprocess2.CalledProcessError:
1011 if not os.path.exists(file_path): 1011 if not os.path.exists(file_path):
1012 continue 1012 continue
1013 raise 1013 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