(self, diff, commit)
| 110 | self.func_commit[func_id] = sha |
| 111 | |
| 112 | def on_modify(self, diff, commit): |
| 113 | assert diff.b_blob.path == diff.a_blob.path |
| 114 | fname = diff.b_blob.path |
| 115 | last_commit = commit.parents[0] |
| 116 | sha = commit.hexsha |
| 117 | |
| 118 | if self.fname_filter(fname): |
| 119 | file_contents = get_contents(self.repo, last_commit, fname) |
| 120 | func_ids, func_ranges = self.func_extractor(file_contents, fname) |
| 121 | try: |
| 122 | modified_intervals = parse_patch(diff.diff.decode("utf-8")) |
| 123 | except UnicodeDecodeError: |
| 124 | print("UnicodeDecodeError Found in change_type {}".format(diff.change_type)) |
| 125 | return -1 |
| 126 | modified_func_ids = get_modified_func_ids(func_ranges, modified_intervals, func_ids) |
| 127 | |
| 128 | for func_id in modified_func_ids: |
| 129 | if func_id in self.func_commit: |
| 130 | add_edge(self.G, sha, self.func_commit[func_id], func_id) |
| 131 | self.func_commit[func_id] = sha |
| 132 | |
| 133 | |
| 134 | def draw_commit_graph(repo_path, language, output_path=None, num_commits=None): |
nothing calls this directly
no test coverage detected