| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Rebaselining tool that automatically produces baselines for all platforms. | 6 """Rebaselining tool that automatically produces baselines for all platforms. |
| 7 | 7 |
| 8 The script does the following for each platform specified: | 8 The script does the following for each platform specified: |
| 9 1. Compile a list of tests that need rebaselining. | 9 1. Compile a list of tests that need rebaselining. |
| 10 2. Download test result archive from buildbot for the platform. | 10 2. Download test result archive from buildbot for the platform. |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 Returns: | 416 Returns: |
| 417 True if the file already exists in SVN or is sucessfully added to SVN. | 417 True if the file already exists in SVN or is sucessfully added to SVN. |
| 418 False otherwise. | 418 False otherwise. |
| 419 """ | 419 """ |
| 420 | 420 |
| 421 if not filename: | 421 if not filename: |
| 422 return False | 422 return False |
| 423 | 423 |
| 424 parent_dir, basename = os.path.split(filename) | 424 parent_dir, basename = os.path.split(filename) |
| 425 if parent_dir == filename: |
| 426 logging.info("No svn checkout found. Assuming it's a git repo and not " |
| 427 "adding") |
| 428 return True |
| 429 |
| 425 original_dir = os.getcwd() | 430 original_dir = os.getcwd() |
| 426 os.chdir(parent_dir) | 431 os.chdir(parent_dir) |
| 427 status_output = RunShell(['svn', 'status', basename], False) | 432 status_output = RunShell(['svn', 'status', basename], False) |
| 428 os.chdir(original_dir) | 433 os.chdir(original_dir) |
| 429 output = status_output.upper() | 434 output = status_output.upper() |
| 430 if output.startswith('A') or output.startswith('M'): | 435 if output.startswith('A') or output.startswith('M'): |
| 431 logging.info(' File already added to SVN: "%s"', filename) | 436 logging.info(' File already added to SVN: "%s"', filename) |
| 432 return True | 437 return True |
| 433 | 438 |
| 434 if output.find('IS NOT A WORKING COPY') >= 0: | 439 if output.find('IS NOT A WORKING COPY') >= 0: |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 LogDashedString('Rebaselining result comparison started', None) | 815 LogDashedString('Rebaselining result comparison started', None) |
| 811 html_generator = HtmlGenerator(options, platforms, rebaselining_tests) | 816 html_generator = HtmlGenerator(options, platforms, rebaselining_tests) |
| 812 html_generator.GenerateHtml() | 817 html_generator.GenerateHtml() |
| 813 html_generator.ShowHtml() | 818 html_generator.ShowHtml() |
| 814 LogDashedString('Rebaselining result comparison done', None) | 819 LogDashedString('Rebaselining result comparison done', None) |
| 815 | 820 |
| 816 sys.exit(0) | 821 sys.exit(0) |
| 817 | 822 |
| 818 if '__main__' == __name__: | 823 if '__main__' == __name__: |
| 819 main() | 824 main() |
| OLD | NEW |