| #!/usr/bin/env python3 |
| # Copyright 2023 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import os.path |
| import sys |
| |
| import git |
| |
| def main(argv): |
| assert os.path.exists('.git') |
| git_obj = git.Git('.git') |
| if argv[0] == 'build_map': |
| assert len(argv) > 1 |
| git.generate_path_to_bug_list(git_obj, argv[1]) |
| elif argv[0] == 'print_heat_map': |
| assert len(argv) > 1 |
| git.print_heat_map(git_obj, argv[1]) |
| elif argv[0] == 'print_file_paths_with_bug_numbers': |
| assert len(argv) > 1 |
| git.print_file_paths_with_bug_numbers(git_obj, argv[1]) |
| else: |
| assert False |
| |
| if __name__ == '__main__': |
| main(sys.argv[1:]) |