def parse_all_target_files(self): logger.info('create parser processes...') blob_parser = BlobParser(extension_dict, self.syntax_trees_dir, self.org_repo.git_dir) parsed_blob = set() for commit in get_reversed_topological_ordered_commits(self.org_repo, self.org_repo.refs): self.num_commits = self.num_commits + 1 if commit.parents: for p in commit.parents: for diff in p.diff(commit): if is_target_blob(diff.b_blob): if diff.b_blob.hexsha not in parsed_blob: blob_parser.parse_blob(diff.b_blob) parsed_blob.add(diff.b_blob.hexsha) else: for entry in commit.tree.traverse(): if isinstance(entry, Blob) and is_target_blob(entry): if entry.hexsha not in parsed_blob: blob_parser.parse_blob(entry) parsed_blob.add(entry.hexsha) logger.info('waiting parser processes') blob_parser.join()
def parse_all_target_files(self): logger.info('create parser processes...') blob_parser = BlobParser(extension_dict, self.syntax_trees_dir, self.org_repo.git_dir) parsed_blob = set() for commit in get_reversed_topological_ordered_commits( self.org_repo, self.org_repo.refs): self.num_commits = self.num_commits + 1 if commit.parents: for p in commit.parents: for diff in p.diff(commit): if is_target_blob(diff.b_blob): if diff.b_blob.hexsha not in parsed_blob: blob_parser.parse_blob(diff.b_blob) parsed_blob.add(diff.b_blob.hexsha) else: for entry in commit.tree.traverse(): if isinstance(entry, Blob) and is_target_blob(entry): if entry.hexsha not in parsed_blob: blob_parser.parse_blob(entry) parsed_blob.add(entry.hexsha) logger.info('waiting parser processes') blob_parser.join()
def is_convert_target(self, blob): if not is_target_blob(blob): return False return self.is_completed_parse(blob)