diff mercurial/rewriteutil.py @ 49060:532b649c1deb stable

rebase: while rewriting desc hashes, ignore ambiguous prefix "hashes" If a repo is sufficiently large, a six digit number "hash prefix" can somewhat easily reference an ambiguous hash prefix. Differential Revision: https://phab.mercurial-scm.org/D12552
author Kyle Lippincott <spectral@google.com>
date Wed, 13 Apr 2022 12:14:17 -0700
parents d4752aeb20f1
children ea98850a136e
line wrap: on
line diff
--- 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