stop using saved state

We can reconstruct the state based on log messages. Otherwise,
it's incorrect as the trimming function removes exported parts
anyway and then we have missing commits
This commit is contained in:
2025-08-24 15:34:08 +02:00
parent 5a28f62fb9
commit 94e57852a0

View File

@@ -40,7 +40,6 @@ class GitExporter:
else:
self.git.create()
self.git.add_gitea_remote(package)
self.state_file = os.path.join(self.git.path, ".git", "_flat_state.yaml")
self.gc_interval = 200
self.cachedir = cachedir
@@ -105,13 +104,6 @@ class GitExporter:
return state_data
def check_repo_state(self, flats, branch_state, branch):
state_data = dict()
if os.path.exists(self.state_file):
with open(self.state_file) as f:
state_data = yaml.safe_load(f)
if not isinstance(state_data, dict):
state_data = {}
else:
state_data = self.reconstruct_state(flats)
logging.debug(f"state data: {state_data}")
@@ -278,10 +270,3 @@ class GitExporter:
)
flat.commit.git_commit = commit
branch_state[flat.branch] = flat.commit
with open(self.state_file, "w") as f:
data = {}
for branch in ["factory", "devel"]:
commit = branch_state[branch]
if commit:
data[branch] = commit.dbid
yaml.dump(data, f)