D10267: tests: update divergence test for `hg fix` to actually result in divergence

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Mar 25 22:13:45 UTC 2021


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

REVISION SUMMARY
  We have a test that checks that `hg fix` errors out if it might cause
  divergence. However, the test simply prunes the commit it then tries
  to fix, so fixing it wouldn't actually cause divergence. That works
  because the implementation is simple enough that it doesn't notice the
  difference. I'm about to make the implementation smarter, so let's fix
  the test first.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1106,14 +1106,13 @@
 
   $ printf "foo\n" > foo.changed
   $ hg commit -Aqm "foo"
-  $ hg debugobsolete `hg parents --template '{node}'`
-  1 new obsolescence markers
-  obsoleted 1 changesets
+  $ hg ci --amend -m rewritten
   $ hg --hidden fix -r 0
   abort: fixing obsolete revision could cause divergence
   [255]
 
   $ hg --hidden fix -r 0 --config experimental.evolution.allowdivergence=true
+  2 new content-divergent changesets
   $ hg cat -r tip foo.changed
   FOO
 



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


More information about the Mercurial-devel mailing list