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:50:08 -0500
commitb5ffa134cbee8913177ae3dc7d4db40a637c5cfa (patch)
treef33bf0cbdf2adf39192988aa2d18fc105155625f
parentceb53836b59c9464865d13de38d73b65b388c4e2 (diff)
downloadgrokmirror-b5ffa134cbee8913177ae3dc7d4db40a637c5cfa.tar.gz
pi-piper: fix crasher on "d" messagesHEADmaster
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: