view tests/test-evolve-issue6648.t @ 6935:954d7ea5cd67 stable tip

stack: when stack base is obsolete, pick any successor, even if at random There are situations when s0 is obsolete and we also cannot pick just one successor for it to use in stack. In such a case, let's pick the "latest" successor from the first set. We're assuming that obsutil.successorssets() returns data in the same order (it should, since it makes sure to sort data internally). Keeping that in mind, while the successor picked for s0 by this code is not based on any sort of sophisticated logic, it should nonetheless be the same every time. This patch is probably not going to completely break anything that was previously working fine, because the previous behavior was to just abort with an exception.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Nov 2024 17:01:02 +0400
parents 17ffdea0edbb
children
line wrap: on
line source

Finding split successors for the correct ancestor (issue6648)
https://bz.mercurial-scm.org/show_bug.cgi?id=6648

  $ . $TESTDIR/testlib/common.sh

  $ cat << EOF >> $HGRCPATH
  > [extensions]
  > evolve =
  > EOF

  $ hg init issue6648
  $ cd issue6648

  $ echo hi > foo
  $ hg commit -qAm 'r0'
  $ echo foo >> foo
  $ echo foo >> foosplit
  $ hg commit -qAm 'r1_splitme'
  $ echo bar > bar
  $ hg commit -qAm 'r2_obsoleteme'
  $ echo baz > baz
  $ hg commit -qAm 'r3'

  $ hg prune -r 2
  1 changesets pruned
  1 new orphan changesets
  $ hg split -r 1 --no-interactive foosplit
  1 files updated, 0 files merged, 3 files removed, 0 files unresolved
  reverting foo
  adding foosplit
  created new head
  no more changes to split

  $ hg update -r 2
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  working directory parent is obsolete! (5c9b6cf2edc5)
  (use 'hg evolve' to update to its parent successor)

  $ hg log -G
  o  changeset:   5:983ec6453b57
  |  tag:         tip
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     r1_splitme
  |
  o  changeset:   4:9ca7a4996099
  |  parent:      0:e9326971c0ba
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     r1_splitme
  |
  | *  changeset:   3:c1e686af368d
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  instability: orphan
  | |  summary:     r3
  | |
  | @  changeset:   2:5c9b6cf2edc5
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  obsolete:    pruned using prune
  | |  summary:     r2_obsoleteme
  | |
  | x  changeset:   1:acdff8eea54c
  |/   user:        test
  |    date:        Thu Jan 01 00:00:00 1970 +0000
  |    obsolete:    split using split as 4:9ca7a4996099, 5:983ec6453b57
  |    summary:     r1_splitme
  |
  o  changeset:   0:e9326971c0ba
     user:        test
     date:        Thu Jan 01 00:00:00 1970 +0000
     summary:     r0
  

handling obsolete wdp works

  $ hg evolve
  update:[5] r1_splitme
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  working directory is now at 983ec6453b57

stabilizing the orphan works

  $ hg evolve
  move:[3] r3
  atop:[5] r1_splitme