[Updated] D12552: rebase: while rewriting desc hashes, ignore ambiguous prefix "hashes"

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Thu Apr 14 09:43:59 UTC 2022


Closed by commit rHG532b649c1deb: rebase: while rewriting desc hashes, ignore ambiguous prefix "hashes" (authored by spectral).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12552?vs=33167&id=33174

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12552/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D12552

AFFECTED FILES
  mercurial/rewriteutil.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -1027,8 +1027,7 @@
   $ hg ci -qAm 'The previous two (parentless) commits had a hash prefix of b04363. Check that rewrite_hash_refs will not fail because of that.'
   $ hg rebase -r . -d 5
   rebasing 8:5c4cdabf5769 tip "The previous two (parentless) commits had a hash prefix of b04363. Check that rewrite_hash_refs will not fail because of that."
-  abort: 00changelog at b04363: ambiguous identifier (known-bad-output !)
-  [50]
+  saved backup bundle to $TESTTMP/keep_merge/.hg/strip-backup/5c4cdabf5769-335e1828-rebase.hg
 
   $ cd ..
 
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -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



To: spectral, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220414/2fd8579c/attachment-0002.html>


More information about the Mercurial-patches mailing list