aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-12-22 16:50:08 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-12-22 16:51:49 -0500
commit61d02fc9a874552ed261a4a3061b10f59f908cfe (patch)
treefaddc628c8a3d5ed4f72da5e7d6b768fe125ce8c
parent72286b705e03879c5b2176f4c0c1876b0439a95b (diff)
downloadgrokmirror-stable-2.0.y.tar.gz
pi-piper: fix crasher on "d" messagesstable-2.0.y
When we have a "d" operation in the public-inbox repository (a message removal from the index), we aren't properly catching the exception and the hook dies. Properly deal with this situation and just move on to the next commit. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgrokmirror/pi_piper.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/grokmirror/pi_piper.py b/grokmirror/pi_piper.py
index 69b6627..1aad091 100755
--- a/grokmirror/pi_piper.py
+++ b/grokmirror/pi_piper.py
@@ -128,8 +128,8 @@ def run_pi_repo(repo: str, pipedef: str, dryrun: bool = False, shallow: bool = F
latest_good = None
ecode = 0
for commit_id, subject in revlist:
- msgbytes = git_get_message_from_pi(repo, commit_id)
- if msgbytes:
+ try:
+ msgbytes = git_get_message_from_pi(repo, commit_id)
if dryrun:
logger.info(' piping: %s (%s b) [DRYRUN]', commit_id, len(msgbytes))
logger.debug(' subject: %s', subject)
@@ -142,6 +142,8 @@ def run_pi_repo(repo: str, pipedef: str, dryrun: bool = False, shallow: bool = F
logger.info(err)
break
latest_good = commit_id
+ except KeyError:
+ logger.info('Skipping %s', commit_id)
if latest_good and not dryrun:
with open(statf, 'w') as fh: