From f1a962f1ad08218c4268ddf4b9e31d4924dc924a Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sun, 22 Sep 2024 21:09:57 -0700 Subject: [PATCH] Further guard against keys not in merge data --- src/python/replay_merge.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/python/replay_merge.py b/src/python/replay_merge.py index c4ce8b7e73..dc44a082d7 100755 --- a/src/python/replay_merge.py +++ b/src/python/replay_merge.py @@ -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 ( @@ -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) @@ -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}", )