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:
@@ -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,14 +104,7 @@ 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)
|
||||
state_data = self.reconstruct_state(flats)
|
||||
|
||||
logging.debug(f"state data: {state_data}")
|
||||
left_to_commit = []
|
||||
@@ -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)
|
||||
|
Reference in New Issue
Block a user