[Request] [+ ] D10917: rewriteutil: check for divergence on unfiltered repo

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Jun 29 21:20:24 UTC 2021


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Before this patch, the code looking for divergence could crash when
  tried to look up a common predecessor in the filtered repo. This patch
  fixes that by checking for divergence in an unfiltered repo.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/rewriteutil.py
  tests/test-amend.t

CHANGE DETAILS

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -281,10 +281,11 @@
   obsoleted 1 changesets
   $ hg co --hidden $node_B_split2
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-BROKEN: Should not complain about a filtered predecessor
+BROKEN: Should not be considered divergence (issue6262)
   $ hg amend -m 'revived B-split2'
-  abort: filtered revision '16084da537dd8f84cfdb3055c633772269d62e1b' (known-bad-output !)
-  [255]
+  abort: cannot amend 809fe227532f, as that creates content-divergence with c68306a86921, from 16084da537dd (known-bad-output !)
+  (add --verbose for details or see 'hg help evolution.instability') (known-bad-output !)
+  [10]
 #endif
 
 Cannot amend public changeset
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -86,7 +86,7 @@
         )
 
     if not obsolete.isenabled(repo, obsolete.allowdivergenceopt):
-        new_divergence = _find_new_divergence(repo, revs)
+        new_divergence = _find_new_divergence(repo.unfiltered(), revs)
         if new_divergence:
             local_ctx, other_ctx, base_ctx = new_divergence
             msg = _(



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210629/f2790548/attachment.html>


More information about the Mercurial-patches mailing list