~monsieuricon/grokmirror

b5ffa134cbee8913177ae3dc7d4db40a637c5cfa — Konstantin Ryabitsev 7 months ago ceb5383 master
pi-piper: fix crasher on "d" messages

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>
1 files changed, 4 insertions(+), 2 deletions(-)

M grokmirror/pi_piper.py
M grokmirror/pi_piper.py => grokmirror/pi_piper.py +4 -2
@@ 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: