From 86056629e7778543dc31c962e7e3f273e1ec48e6 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 9 Nov 2021 20:31:21 -0800 Subject: file/release bugfix: handle files with multiple edits --- python/fatcat_tools/cleanups/file_release_bugfix.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/fatcat_tools/cleanups/file_release_bugfix.py b/python/fatcat_tools/cleanups/file_release_bugfix.py index 5ac69d1a..dc27f9b5 100644 --- a/python/fatcat_tools/cleanups/file_release_bugfix.py +++ b/python/fatcat_tools/cleanups/file_release_bugfix.py @@ -142,17 +142,17 @@ class FileReleaseBugfix(EntityImporter): # fetch existing history to verify mismatch history = self.api.get_file_history(existing.ident) - if len(history) != 1: - self.counts["skip-existing-history-updated"] += 1 - return False + for entry in history: + if entry.editgroup.editor.is_bot is not True: + self.counts["skip-existing-edit-history-human"] += 1 + return False - bad_edit = history[0].edit + bad_edit = history[-1].edit if bad_edit.extra != fe.edit_extra: self.counts["skip-existing-edit-history-extra-mismatch"] += 1 return False - bad_editgroup = history[0].editgroup - + bad_editgroup = history[-1].editgroup if not bad_editgroup.extra: self.counts["skip-existing-editgroup-missing-extra"] += 1 return False -- cgit v1.2.3