| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """ Upload actual GM results to the skia-autogen SVN repository to aid in | 6 """ Upload actual GM results to the skia-autogen SVN repository to aid in |
| 7 rebaselining. """ | 7 rebaselining. """ |
| 8 | 8 |
| 9 from build_step import BuildStep | 9 from build_step import BuildStep |
| 10 from common import chromium_utils | 10 from common import chromium_utils |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 # Call MergeIntoSvn to actually perform the work. | 76 # Call MergeIntoSvn to actually perform the work. |
| 77 # TODO: We should do something a bit more sophisticated, to address | 77 # TODO: We should do something a bit more sophisticated, to address |
| 78 # https://code.google.com/p/skia/issues/detail?id=720 ('UploadGMs step | 78 # https://code.google.com/p/skia/issues/detail?id=720 ('UploadGMs step |
| 79 # should be skipped when re-running old revisions of the buildbot') | 79 # should be skipped when re-running old revisions of the buildbot') |
| 80 merge_options = Options() | 80 merge_options = Options() |
| 81 # pylint: disable=W0201 | 81 # pylint: disable=W0201 |
| 82 merge_options.commit_message = 'UploadGMResults of r%s on %s' % ( | 82 merge_options.commit_message = 'UploadGMResults of r%s on %s' % ( |
| 83 self._got_revision, self._args['builder_name']) | 83 self._got_revision, self._args['builder_name']) |
| 84 # pylint: disable=W0201 | 84 # pylint: disable=W0201 |
| 85 merge_options.dest_svn_url = '%s/%s/%s/%s' % ( | 85 merge_options.dest_svn_url = '%s/%s' % ( |
| 86 gm_actual_svn_baseurl, self._args['gm_image_subdir'], | 86 gm_actual_svn_baseurl, self._args['builder_name']) |
| 87 self._args['builder_name'], self._args['gm_image_subdir']) | |
| 88 # pylint: disable=W0201 | 87 # pylint: disable=W0201 |
| 89 merge_options.merge_dir_path = os.path.join(gm_merge_basedir, | 88 merge_options.merge_dir_path = os.path.join(gm_merge_basedir, |
| 90 self._args['gm_image_subdir']) | 89 self._args['builder_name']) |
| 91 # Clear out the merge_dir, in case it has old imagefiles in it from the | 90 # Clear out the merge_dir, in case it has old imagefiles in it from the |
| 92 # bad old days when we were still uploading actual images to skia-autogen. | 91 # bad old days when we were still uploading actual images to skia-autogen. |
| 93 # This resolves https://code.google.com/p/skia/issues/detail?id=1362 ('some | 92 # This resolves https://code.google.com/p/skia/issues/detail?id=1362 ('some |
| 94 # buildbots are still uploading image files to skia-autogen after r9709') | 93 # buildbots are still uploading image files to skia-autogen after r9709') |
| 95 # | 94 # |
| 96 # We wouldn't want to do this for a mergedir like that used for the | 95 # We wouldn't want to do this for a mergedir like that used for the |
| 97 # Doxygen docs, since that dir holds so many files.. but this mergedir | 96 # Doxygen docs, since that dir holds so many files.. but this mergedir |
| 98 # only holds the actual-results.json file now. So the overhead of | 97 # only holds the actual-results.json file now. So the overhead of |
| 99 # downloading that file from the repo every time isn't a big deal. | 98 # downloading that file from the repo every time isn't a big deal. |
| 100 chromium_utils.RemoveDirectory(merge_options.merge_dir_path) | 99 chromium_utils.RemoveDirectory(merge_options.merge_dir_path) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 117 print 'Uploading %d JSON files to skia-autogen: %s...' % ( | 116 print 'Uploading %d JSON files to skia-autogen: %s...' % ( |
| 118 len(files_to_upload), files_to_upload) | 117 len(files_to_upload), files_to_upload) |
| 119 for filename in files_to_upload: | 118 for filename in files_to_upload: |
| 120 src_filepath = os.path.join(src_dir, filename) | 119 src_filepath = os.path.join(src_dir, filename) |
| 121 shutil.copy(src_filepath, tempdir) | 120 shutil.copy(src_filepath, tempdir) |
| 122 self._SVNUploadDir(src_dir=tempdir) | 121 self._SVNUploadDir(src_dir=tempdir) |
| 123 shutil.rmtree(tempdir) | 122 shutil.rmtree(tempdir) |
| 124 | 123 |
| 125 def _Run(self): | 124 def _Run(self): |
| 126 gm_output_dir = os.path.join(os.pardir, os.pardir, 'gm', 'actual', | 125 gm_output_dir = os.path.join(os.pardir, os.pardir, 'gm', 'actual', |
| 127 self._args['gm_image_subdir']) | 126 self._args['builder_name']) |
| 128 self._GSUploadAllImages(src_dir=gm_output_dir) | 127 self._GSUploadAllImages(src_dir=gm_output_dir) |
| 129 self._SVNUploadJsonFiles(src_dir=gm_output_dir) | 128 self._SVNUploadJsonFiles(src_dir=gm_output_dir) |
| 130 | 129 |
| 131 | 130 |
| 132 if '__main__' == __name__: | 131 if '__main__' == __name__: |
| 133 sys.exit(BuildStep.RunBuildStep(UploadGMResults)) | 132 sys.exit(BuildStep.RunBuildStep(UploadGMResults)) |
| OLD | NEW |