diff options
author | simonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-18 19:07:58 +0000 |
---|---|---|
committer | simonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-18 19:07:58 +0000 |
commit | 8f6173ec6b57151ae1f8b68a075ccb8ce011e8b7 (patch) | |
tree | 022ada2e9fc6e63d0f6bd64a32a23b24ac94b3e2 /tools/bisect_utils.py | |
parent | 846f455b8100504eaa51733a26176922d6ef42f8 (diff) | |
download | chromium_src-8f6173ec6b57151ae1f8b68a075ccb8ce011e8b7.zip chromium_src-8f6173ec6b57151ae1f8b68a075ccb8ce011e8b7.tar.gz chromium_src-8f6173ec6b57151ae1f8b68a075ccb8ce011e8b7.tar.bz2 |
Added call to stop goma in case it's still running from a build that timed out.
Added --verbose parameter to sync commands.
Added newlines around annotations since bot seems to trip up on finding them if they get appended to previous output.
Added --reset --force --delete_unversioned_trees to prepare step in case previous run was aborted/crashed and there's cruft leftover.
BUG=
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/12780015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/bisect_utils.py')
-rw-r--r-- | tools/bisect_utils.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/tools/bisect_utils.py b/tools/bisect_utils.py index 0439d76..4447f48 100644 --- a/tools/bisect_utils.py +++ b/tools/bisect_utils.py @@ -38,15 +38,19 @@ def OutputAnnotationStepStart(name): Args: name: The name of the step. """ + print print '@@@SEED_STEP %s@@@' % name print '@@@STEP_CURSOR %s@@@' % name print '@@@STEP_STARTED@@@' + print def OutputAnnotationStepClosed(): """Outputs appropriate annotation to signal the closing of a step to a trybot.""" + print print '@@@STEP_CLOSED@@@' + print def CreateAndChangeToSourceDirectory(working_directory): @@ -99,19 +103,28 @@ def RunGClientAndCreateConfig(): return return_code -def RunGClientAndSync(): +def RunGClientAndSync(reset): """Runs gclient and does a normal sync. + Args: + reset: Whether to reset any changes to the depot. + Returns: The return code of the call. """ - return RunGClient(['sync']) + params = ['sync', '--verbose'] + if reset: + params.extend(['--reset', '--force', '--delete_unversioned_trees']) + return RunGClient(params) -def SetupGitDepot(output_buildbot_annotations): +def SetupGitDepot(output_buildbot_annotations, reset): """Sets up the depot for the bisection. The depot will be located in a subdirectory called 'bisect'. + Args: + reset: Whether to reset any changes to the depot. + Returns: True if gclient successfully created the config file and did a sync, False otherwise. @@ -124,7 +137,7 @@ def SetupGitDepot(output_buildbot_annotations): passed = False if not RunGClientAndCreateConfig(): - if not RunGClientAndSync(): + if not RunGClientAndSync(reset): passed = True if output_buildbot_annotations: @@ -134,12 +147,13 @@ def SetupGitDepot(output_buildbot_annotations): return passed -def CreateBisectDirectoryAndSetupDepot(opts): +def CreateBisectDirectoryAndSetupDepot(opts, reset=False): """Sets up a subdirectory 'bisect' and then retrieves a copy of the depot there using gclient. Args: opts: The options parsed from the command line through parse_args(). + reset: Whether to reset any changes to the depot. Returns: Returns 0 on success, otherwise 1. @@ -149,7 +163,7 @@ def CreateBisectDirectoryAndSetupDepot(opts): print return 1 - if not SetupGitDepot(opts.output_buildbot_annotations): + if not SetupGitDepot(opts.output_buildbot_annotations, reset): print 'Error: Failed to grab source.' print return 1 |