diff -r 1c00777702da -r ea98850a136e mercurial/rewriteutil.py --- a/mercurial/rewriteutil.py Fri Apr 15 11:20:49 2022 -0400 +++ b/mercurial/rewriteutil.py Tue Apr 19 10:53:58 2022 -0400 @@ -214,9 +214,9 @@ for h in hashes: try: fullnode = scmutil.resolvehexnodeidprefix(unfi, h) - except error.WdirUnsupported: - # Someone has an fffff... in a commit message we're - # rewriting. Don't try rewriting that. + except (error.WdirUnsupported, error.AmbiguousPrefixLookupError): + # Someone has an fffff... or some other prefix that's ambiguous in a + # commit message we're rewriting. Don't try rewriting that. continue if fullnode is None: continue