| 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 | 6 |
| 7 """ Apply a diff to patch a Skia checkout. """ | 7 """ Apply a diff to patch a Skia checkout. """ |
| 8 | 8 |
| 9 | 9 |
| 10 from ast import literal_eval | 10 from ast import literal_eval |
| 11 from build_step import BuildStep, BuildStepFailure | 11 from build_step import BuildStep, BuildStepFailure |
| 12 from utils import shell_utils | 12 from py.utils import shell_utils |
| 13 from utils.git_utils import GIT | 13 from py.utils.git_utils import GIT |
| 14 import os | 14 import os |
| 15 import shutil | 15 import shutil |
| 16 import sys | 16 import sys |
| 17 import tempfile | 17 import tempfile |
| 18 import urllib | 18 import urllib |
| 19 import urllib2 | 19 import urllib2 |
| 20 | 20 |
| 21 | 21 |
| 22 if os.name == 'nt': | 22 if os.name == 'nt': |
| 23 SVN = 'svn.bat' | 23 SVN = 'svn.bat' |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 patch_level = (patch_level + 1) % 2 | 75 patch_level = (patch_level + 1) % 2 |
| 76 print 'Trying patch level %d instead...' % patch_level | 76 print 'Trying patch level %d instead...' % patch_level |
| 77 shell_utils.run(get_patch_cmd(patch_level, patch_file.name)) | 77 shell_utils.run(get_patch_cmd(patch_level, patch_file.name)) |
| 78 | 78 |
| 79 finally: | 79 finally: |
| 80 shutil.rmtree(temp_dir) | 80 shutil.rmtree(temp_dir) |
| 81 | 81 |
| 82 | 82 |
| 83 if '__main__' == __name__: | 83 if '__main__' == __name__: |
| 84 sys.exit(BuildStep.RunBuildStep(ApplyPatch)) | 84 sys.exit(BuildStep.RunBuildStep(ApplyPatch)) |
| OLD | NEW |