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

Side by Side Diff: tools/utils.py

Issue 52003002: - Workaround SVN inconsistencies when building locally. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « 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) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 # This file contains a set of utilities functions used by other Python-based 5 # This file contains a set of utilities functions used by other Python-based
6 # scripts. 6 # scripts.
7 7
8 import commands 8 import commands
9 import os 9 import os
10 import platform 10 import platform
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return revision 294 return revision
295 295
296 # maybe the builder is using git-svn, try that 296 # maybe the builder is using git-svn, try that
297 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, 297 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE,
298 stderr = subprocess.STDOUT, shell=IsWindows(), cwd = DART_DIR) 298 stderr = subprocess.STDOUT, shell=IsWindows(), cwd = DART_DIR)
299 output, _ = p.communicate() 299 output, _ = p.communicate()
300 revision = ParseSvnInfoOutput(output) 300 revision = ParseSvnInfoOutput(output)
301 if revision: 301 if revision:
302 return revision 302 return revision
303 303
304 # Only fail on the buildbot in case of a SVN client version mismatch
305 if user != 'chrome-bot':
kustermann 2013/10/30 11:15:21 Where is 'user' defined?
306 return '0'
307
304 return None 308 return None
305 309
306 def ParseSvnInfoOutput(output): 310 def ParseSvnInfoOutput(output):
307 revision_match = re.search('Last Changed Rev: (\d+)', output) 311 revision_match = re.search('Last Changed Rev: (\d+)', output)
308 if revision_match: 312 if revision_match:
309 return revision_match.group(1) 313 return revision_match.group(1)
310 return None 314 return None
311 315
312 def RewritePathSeparator(path, workspace): 316 def RewritePathSeparator(path, workspace):
313 # Paths in test files are always specified using '/' 317 # Paths in test files are always specified using '/'
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 self._temp_dir = tempfile.mkdtemp(self._prefix) 463 self._temp_dir = tempfile.mkdtemp(self._prefix)
460 return self._temp_dir 464 return self._temp_dir
461 465
462 def __exit__(self, *_): 466 def __exit__(self, *_):
463 shutil.rmtree(self._temp_dir, ignore_errors=True) 467 shutil.rmtree(self._temp_dir, ignore_errors=True)
464 468
465 469
466 if __name__ == "__main__": 470 if __name__ == "__main__":
467 import sys 471 import sys
468 Main(sys.argv) 472 Main(sys.argv)
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