From e0a39d2d619ac5f28b6233c0ed15da2cc5920418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Wed, 3 Jul 2024 20:43:44 +0200 Subject: [PATCH] pygit2 update: Convert to new pygit2 sed -i 's/\(\w\w*\).hex/str(\1.id)/g' (git grep -l "\w*.hex") --- git_explode/exploder.py | 4 ++-- git_explode/listener.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git_explode/exploder.py b/git_explode/exploder.py index 19452a7..ee96f88 100644 --- a/git_explode/exploder.py +++ b/git_explode/exploder.py @@ -97,7 +97,7 @@ def explode(self, commits, deps_from, deps_on): while todo: commit = todo.pop(0) - sha = commit.hex + sha = str(commit.id) self.logger.debug("Exploding %s" % GitUtils.commit_summary(commit)) if unexploded_deps_from[sha]: abort("BUG: unexploded deps from %s" % @@ -151,7 +151,7 @@ def queue_new_leaves(self, todo, exploded_commit, commits, deps_on, added to the explode queue. """ - sha1 = exploded_commit.hex + sha1 = str(exploded_commit.id) for dependent in deps_on[sha1]: del unexploded_deps_from[dependent][sha1] if not unexploded_deps_from[dependent]: diff --git a/git_explode/listener.py b/git_explode/listener.py index 079e177..df8dc8c 100644 --- a/git_explode/listener.py +++ b/git_explode/listener.py @@ -18,14 +18,14 @@ def __init__(self, options): def new_commit(self, commit): """Adds the commit if it doesn't already exist. """ - sha1 = commit.hex + sha1 = str(commit.id) for d in (self._dependencies_from, self._dependencies_on): if sha1 not in d: d[sha1] = {} def new_dependency(self, dependee, dependency, path, line_num): - src = dependee.hex - dst = dependency.hex + src = str(dependee.id) + dst = str(dependency.id) cause = "%s:%d" % (path, line_num) self._dependencies_from[src][dst] = cause