| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 return revision | 301 return revision |
| 302 | 302 |
| 303 # maybe the builder is using git-svn, try that | 303 # maybe the builder is using git-svn, try that |
| 304 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, | 304 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, |
| 305 stderr = subprocess.STDOUT, shell=IsWindows(), cwd = DART_DIR) | 305 stderr = subprocess.STDOUT, shell=IsWindows(), cwd = DART_DIR) |
| 306 output, _ = p.communicate() | 306 output, _ = p.communicate() |
| 307 revision = ParseSvnInfoOutput(output) | 307 revision = ParseSvnInfoOutput(output) |
| 308 if revision: | 308 if revision: |
| 309 return revision | 309 return revision |
| 310 | 310 |
| 311 # Only fail on the buildbot in case of a SVN client version mismatch | 311 # Only fail on the buildbot in case of a SVN client version mismatch. |
| 312 user = GetUserName() |
| 312 if user != 'chrome-bot': | 313 if user != 'chrome-bot': |
| 313 return '0' | 314 return '0' |
| 314 | 315 |
| 315 return None | 316 return None |
| 316 | 317 |
| 317 def ParseSvnInfoOutput(output): | 318 def ParseSvnInfoOutput(output): |
| 318 revision_match = re.search('Last Changed Rev: (\d+)', output) | 319 revision_match = re.search('Last Changed Rev: (\d+)', output) |
| 319 if revision_match: | 320 if revision_match: |
| 320 return revision_match.group(1) | 321 return revision_match.group(1) |
| 321 return None | 322 return None |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 os.chdir(self._working_directory) | 484 os.chdir(self._working_directory) |
| 484 | 485 |
| 485 def __exit__(self, *_): | 486 def __exit__(self, *_): |
| 486 print "Enter directory = ", self._old_cwd | 487 print "Enter directory = ", self._old_cwd |
| 487 os.chdir(self._old_cwd) | 488 os.chdir(self._old_cwd) |
| 488 | 489 |
| 489 | 490 |
| 490 if __name__ == "__main__": | 491 if __name__ == "__main__": |
| 491 import sys | 492 import sys |
| 492 Main(sys.argv) | 493 Main(sys.argv) |
| OLD | NEW |