OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Utility functions used by the bisect tool. | 5 """Utility functions used by the bisect tool. |
6 | 6 |
7 This includes functions related to checking out the depot and outputting | 7 This includes functions related to checking out the depot and outputting |
8 annotations for the Buildbot waterfall. | 8 annotations for the Buildbot waterfall. |
9 """ | 9 """ |
10 | 10 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 """Run a git subcommand, returning its output and return code. | 433 """Run a git subcommand, returning its output and return code. |
434 | 434 |
435 Args: | 435 Args: |
436 command: A list containing the args to git. | 436 command: A list containing the args to git. |
437 cwd: A directory to change to while running the git command (optional). | 437 cwd: A directory to change to while running the git command (optional). |
438 | 438 |
439 Returns: | 439 Returns: |
440 A tuple of the output and return code. | 440 A tuple of the output and return code. |
441 """ | 441 """ |
442 command = ['git'] + command | 442 command = ['git'] + command |
443 | |
444 return RunProcessAndRetrieveOutput(command, cwd=cwd) | 443 return RunProcessAndRetrieveOutput(command, cwd=cwd) |
445 | 444 |
446 | 445 |
447 def CreateBisectDirectoryAndSetupDepot(opts, custom_deps): | 446 def CreateBisectDirectoryAndSetupDepot(opts, custom_deps): |
448 """Sets up a subdirectory 'bisect' and then retrieves a copy of the depot | 447 """Sets up a subdirectory 'bisect' and then retrieves a copy of the depot |
449 there using gclient. | 448 there using gclient. |
450 | 449 |
451 Args: | 450 Args: |
452 opts: The options parsed from the command line through parse_args(). | 451 opts: The options parsed from the command line through parse_args(). |
453 custom_deps: A dictionary of additional dependencies to add to .gclient. | 452 custom_deps: A dictionary of additional dependencies to add to .gclient. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 return sys.platform.startswith('linux') | 572 return sys.platform.startswith('linux') |
574 | 573 |
575 | 574 |
576 def IsMacHost(): | 575 def IsMacHost(): |
577 """Checks whether or not the script is running on Mac. | 576 """Checks whether or not the script is running on Mac. |
578 | 577 |
579 Returns: | 578 Returns: |
580 True if running on Mac. | 579 True if running on Mac. |
581 """ | 580 """ |
582 return sys.platform.startswith('darwin') | 581 return sys.platform.startswith('darwin') |
OLD | NEW |