summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-09 20:31:21 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-11-09 20:34:55 -0800
commit86056629e7778543dc31c962e7e3f273e1ec48e6 (patch)
tree6413560099d0ddff718e9ac5b9341d1115e07434 /python
parentfd0cf6b55567e3081b9e57e2423d6d0e529ace41 (diff)
downloadfatcat-86056629e7778543dc31c962e7e3f273e1ec48e6.tar.gz
fatcat-86056629e7778543dc31c962e7e3f273e1ec48e6.zip
file/release bugfix: handle files with multiple edits
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/cleanups/file_release_bugfix.py12
1 files 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