(self, old_filename, old_src, new_filename, new_src, patch)
| 15 | self._pparser = PatchParser() |
| 16 | |
| 17 | def update_graph(self, old_filename, old_src, new_filename, new_src, patch): |
| 18 | # on add, rename, modify: update_roots = [new_root] |
| 19 | # on delete: update_roots = [] |
| 20 | update_root = [] |
| 21 | |
| 22 | # on add: modified_func = {} |
| 23 | # on rename, modify, delete: modified_func is computed by |
| 24 | # parsing patch and call get_changed_functions |
| 25 | modified_func = {} |
| 26 | |
| 27 | if old_src is not None: |
| 28 | old_root = transform_src_to_tree(old_src) |
| 29 | if old_root is None: |
| 30 | return {}, {} |
| 31 | |
| 32 | modified_func = get_changed_functions( |
| 33 | *get_func_ranges_c(old_root), |
| 34 | *self._parse_patch(patch)) |
| 35 | |
| 36 | if new_src is not None: |
| 37 | new_root = transform_src_to_tree(new_src) |
| 38 | if new_root is None: |
| 39 | return {}, {} |
| 40 | update_root = [new_root] |
| 41 | |
| 42 | # update call graph |
| 43 | # if on delete, then new_func is expected to be an empty dict |
| 44 | new_func = update_call_graph_c(self.graph, update_root, modified_func) |
| 45 | |
| 46 | # return history |
| 47 | return {**new_func, **modified_func}, {} |
| 48 | |
| 49 | def parse(self, old_filename, old_src, new_filename, new_src, patch): |
| 50 | """Return None if there is an error""" |
nothing calls this directly
no test coverage detected