Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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) |
| OLD | NEW |