Skip to content

Commit

Permalink
Further guard against keys not in merge data
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Sep 23, 2024
1 parent d588d84 commit f1a962f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/python/replay_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ def merge_replay(
]
assert repo.local_repo_path.exists()

if f"{merge_tool.name}_merge_fingerprint" in merge_data:
expected_merge_fingerprint = merge_data[
f"{merge_tool.name}_merge_fingerprint"
]
else:
expected_merge_fingerprint = "MISSING!"

if (
merge_result
not in (
Expand All @@ -313,8 +320,7 @@ def merge_replay(
)
and (
(not dont_check_fingerprints)
and merge_data[f"{merge_tool.name}_merge_fingerprint"]
!= merge_fingerprint
and (expected_merge_fingerprint != merge_fingerprint)
)
and ("spork" not in merge_tool.name)
and ("intellimerge" not in merge_tool.name)
Expand All @@ -335,9 +341,8 @@ def merge_replay(
print(f"=================== end of {log_path}.")
raise Exception(
f"fingerprints differ: after merge of {workdir} with {merge_tool}, found"
+ f" {merge_fingerprint} but expected "
+ f"{merge_data[f'{merge_tool.name}_merge_fingerprint']} at log path {log_path}"
+ f" and repo path {repo.local_repo_path}",
+ f" {merge_fingerprint} but expected {expected_merge_fingerprint}"
+ f" at log path {log_path} and repo path {repo.local_repo_path}",
merge_result,
f"idx {merge_idx}",
)
Expand Down

0 comments on commit f1a962f

Please sign in to comment.