Skip to content

Commit

Permalink
Add --reset sync commands in bisect script. Was failing to sync due t…
Browse files Browse the repository at this point in the history
…o missing libjingle in .DEPS.git for a while, so use --reset and --force to bring depot back to working state.

BUG=266324
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/21015015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214856 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
simonhatch@chromium.org committed Jul 31, 2013
1 parent fc877cf commit 47681fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tools/bisect-perf-regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def SyncToRevisionWithGClient(self, revision):
The return code of the call.
"""
return bisect_utils.RunGClient(['sync', '--revision',
revision, '--verbose', '--nohooks'])
revision, '--verbose', '--nohooks', '--reset', '--force'])

def SyncToRevisionWithRepo(self, timestamp):
"""Uses repo to sync all the underlying git depots to the specified
Expand Down
16 changes: 6 additions & 10 deletions tools/bisect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,25 @@ def RemoveThirdPartyWebkitDirectory():
return True


def RunGClientAndSync(reset, cwd=None):
def RunGClientAndSync(cwd=None):
"""Runs gclient and does a normal sync.
Args:
reset: Whether to reset any changes to the depot.
cwd: Working directory to run from.
Returns:
The return code of the call.
"""
params = ['sync', '--verbose', '--nohooks']
if reset:
params.extend(['--reset', '--force', '--delete_unversioned_trees'])
params = ['sync', '--verbose', '--nohooks', '--reset', '--force']
return RunGClient(params, cwd=cwd)


def SetupGitDepot(opts, reset):
def SetupGitDepot(opts):
"""Sets up the depot for the bisection. The depot will be located in a
subdirectory called 'bisect'.
Args:
opts: The options parsed from the command line through parse_args().
reset: Whether to reset any changes to the depot.
Returns:
True if gclient successfully created the config file and did a sync, False
Expand All @@ -271,7 +267,7 @@ def SetupGitDepot(opts, reset):

if passed_deps_check:
RunGClient(['revert'])
if not RunGClientAndSync(reset):
if not RunGClientAndSync():
passed = True

if opts.output_buildbot_annotations:
Expand Down Expand Up @@ -380,7 +376,7 @@ def SetupPlatformBuildEnvironment(opts):
return True


def CreateBisectDirectoryAndSetupDepot(opts, reset=False):
def CreateBisectDirectoryAndSetupDepot(opts):
"""Sets up a subdirectory 'bisect' and then retrieves a copy of the depot
there using gclient.
Expand All @@ -396,7 +392,7 @@ def CreateBisectDirectoryAndSetupDepot(opts, reset=False):
print
return 1

if not SetupGitDepot(opts, reset):
if not SetupGitDepot(opts):
print 'Error: Failed to grab source.'
print
return 1
Expand Down
2 changes: 1 addition & 1 deletion tools/prepare-bisect-perf-regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main():
parser.print_help()
return 1

return bisect_utils.CreateBisectDirectoryAndSetupDepot(opts, True)
return bisect_utils.CreateBisectDirectoryAndSetupDepot(opts)


if __name__ == '__main__':
Expand Down

0 comments on commit 47681fd

Please sign in to comment.