Patchwork D11009: tests: demonstrate crash when common predecessor of divergence is hidden

login
register
mail settings
Submitter phabricator
Date July 7, 2021, 6:22 p.m.
Message ID <differential-rev-PHID-DREV-mbwp7vyl2anaz4oxrjji-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49323/
State Superseded
Headers show

Comments

phabricator - July 7, 2021, 6:22 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-amend.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -250,6 +250,32 @@ 
   [10]
   $ hg amend -m divergent --config experimental.evolution.allowdivergence=true
   2 new content-divergent changesets
+
+Hidden common predecessor of divergence does not cause crash
+
+First create C1 as a pruned successor of C
+  $ hg co C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg amend -m C1
+  $ hg tag --local C1
+  $ hg debugobsolete $(hg log -T '{node}' -r C1)
+  1 new obsolescence markers
+  obsoleted 1 changesets
+Now create C2 as other side of divergence (not actually divergent because C1 is
+pruned)
+  $ hg co C
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg amend -m C2
+  1 new orphan changesets
+Make the common predecessor (C) pruned
+  $ hg tag --local --remove C
+  $ hg co C1
+  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]
 #endif
 
 Cannot amend public changeset