--- a/mercurial/rewriteutil.py Wed Apr 13 13:15:33 2022 -0700
+++ b/mercurial/rewriteutil.py Wed Apr 13 12:14:17 2022 -0700
@@ -215,9 +215,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