| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 """Forcibly update the local checkout.""" | 7 """Forcibly update the local checkout.""" |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 import os | 11 import os |
| 12 import shlex | 12 import shlex |
| 13 import sys | 13 import sys |
| 14 | 14 |
| 15 import misc | 15 BUILDBOT_PATH = os.path.realpath(os.path.join( |
| 16 os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir, os.pardir) |
| 17 ) |
| 16 | 18 |
| 17 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'site_config')) | 19 sys.path.append(os.path.join(BUILDBOT_PATH, 'common')) |
| 18 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'third_party', | 20 sys.path.append(os.path.join(BUILDBOT_PATH, 'site_config')) |
| 21 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', |
| 19 'chromium_buildbot', 'scripts')) | 22 'chromium_buildbot', 'scripts')) |
| 20 | 23 |
| 21 import gclient_utils | 24 import gclient_utils |
| 22 import git_utils | 25 from py.utils import git_utils |
| 23 import shell_utils | 26 from py.utils import misc |
| 27 from py.utils import shell_utils |
| 24 import skia_vars | 28 import skia_vars |
| 25 | 29 |
| 26 | 30 |
| 27 BUILDBOT_GIT_URL = skia_vars.GetGlobalVariable('buildbot_git_url') | 31 BUILDBOT_GIT_URL = skia_vars.GetGlobalVariable('buildbot_git_url') |
| 28 GOT_REVISION_PATTERN = 'Skiabot scripts updated to %s' | 32 GOT_REVISION_PATTERN = 'Skiabot scripts updated to %s' |
| 29 | 33 |
| 30 | 34 |
| 31 def force_update(): | 35 def force_update(): |
| 32 with misc.ChDir(os.path.join(misc.BUILDBOT_PATH, os.pardir)): | 36 with misc.ChDir(os.path.join(misc.BUILDBOT_PATH, os.pardir)): |
| 33 # Run "gclient" before doing anything else to ensure that we get the | 37 # Run "gclient" before doing anything else to ensure that we get the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 48 gclient_utils.Sync(revisions=[('buildbot', buildbot_revision)], | 52 gclient_utils.Sync(revisions=[('buildbot', buildbot_revision)], |
| 49 verbose=True, force=True) | 53 verbose=True, force=True) |
| 50 got_revision = gclient_utils.GetCheckedOutHash() | 54 got_revision = gclient_utils.GetCheckedOutHash() |
| 51 print GOT_REVISION_PATTERN % got_revision | 55 print GOT_REVISION_PATTERN % got_revision |
| 52 | 56 |
| 53 return gclient_utils.GetCheckedOutHash() | 57 return gclient_utils.GetCheckedOutHash() |
| 54 | 58 |
| 55 | 59 |
| 56 if __name__ == '__main__': | 60 if __name__ == '__main__': |
| 57 force_update() | 61 force_update() |
| OLD | NEW |