# HG changeset patch # User Martin von Zweigbergk # Date 1625000554 25200 # Node ID debc29900b97a51e5b26c06ff3d49c44f4038b6b # Parent 93ca7d3278b97aabed8491d84dacd2c579bbd77d rewriteutil: look up common predecessor on unfiltered repo 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 looking up the common predecessor in an unfiltered repo. Differential Revision: https://phab.mercurial-scm.org/D10917 diff -r 93ca7d3278b9 -r debc29900b97 mercurial/rewriteutil.py --- a/mercurial/rewriteutil.py Wed Jul 07 10:07:28 2021 -0700 +++ b/mercurial/rewriteutil.py Tue Jun 29 14:02:34 2021 -0700 @@ -145,7 +145,7 @@ for r in obsrevs: div = find_new_divergence_from(repo, repo[r]) if div: - return (repo[r], repo[div[0]], repo[div[1]]) + return (repo[r], repo[div[0]], repo.unfiltered()[div[1]]) return None diff -r 93ca7d3278b9 -r debc29900b97 tests/test-amend.t --- a/tests/test-amend.t Wed Jul 07 10:07:28 2021 -0700 +++ b/tests/test-amend.t Tue Jun 29 14:02:34 2021 -0700 @@ -273,9 +273,9 @@ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Try to cause divergence $ hg amend -m C11 - abort: filtered revision '26805aba1e600a82e93661149f2313866a221a7b' (known-bad-output !) - [255] - [10] + abort: cannot amend 2758767f5d17, as that creates content-divergence with bfcb433a0dea, from 26805aba1e60 + (add --verbose for details or see 'hg help evolution.instability') + [10] #endif Cannot amend public changeset