[Bug 6648] New: list index out of range when running `hg evolve` on obsolete commit with no successors

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Feb 17 21:13:45 UTC 2022


https://bz.mercurial-scm.org/show_bug.cgi?id=6648

            Bug ID: 6648
           Summary: list index out of range when running `hg evolve` on
                    obsolete commit with no successors
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: evolution
          Assignee: bugzilla at mercurial-scm.org
          Reporter: hg at pewpew.net
                CC: mercurial-devel at mercurial-scm.org,
                    pierre-yves.david at ens-lyon.org
    Python Version: ---

If I create a chain of commits (let's call this revisions 0-1-2), split 1,
prune 2, and then update to 2 and try to run `hg evolve`, it crashes with `list
index out of range` as of change 431bf23d.

Reproduction steps:

```
$ hg init
$ echo hi > foo && hg commit -qAm 'r0'
$ echo -e "hi_r3\nhi_r4" >> foo && hg commit -qm 'r1_splitme'
$ echo bar > bar && hg commit -qAm 'r2_obsoleteme'

# This is just so that we don't have to use --hidden below.
$ hg tag --local -r 2 bar
$ hg prune -r 2
$ hg split
# Split r1_splitme into two revisions, whatever way you want

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

# When using evolve from 46858e6f (aka 431bf23d^)
$ hg evolve
parent is obsolete with multiple successors:
3 75ce52d1 "hi_r3"
4 749ae671 tip "hi_r4"

# When using evolve from 431bf23d
hg evolve --config extensions.evolve=
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.9.9 (main, Jan 12 2022, 16:10:51) [GCC 11.2.0]
** Mercurial Distributed SCM (version 6.0.2+hg355.02e9ad08999b)
** Extensions loaded: evolve 10.5.0.dev
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/evolvecmd.py", line
1822, in solveobswdp
    ctx = repo[utility._singlesuccessor(repo, oldctx)]
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/utility.py", line 127,
in _singlesuccessor
    raise MultipleSuccessorsError(newer)
hgext3rd.evolve.utility.MultipleSuccessorsError:
[[b'u\xceR\xd1\xe8#\xb7M\x16\x96YWZz\xb6\xfc*\xbfQ\xb9',
b't\x9a\xe6qM>\xcf\xab\x8b\x07\xabD\xfei\xfd=\x00\x1e\x9f\xb0']]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hg", line 61, in <module>
    dispatch.run()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 144, in run
    status = dispatch(req)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 250, in
dispatch
    status = _rundispatch(req)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 299, in
_rundispatch
    ret = _runcatch(req) or 0
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 487, in
_runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 497, in
_callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/lib/python3/dist-packages/mercurial/scmutil.py", line 153, in
callcatch
    return func()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 474, in
_runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1290, in
_dispatch
    return runcommand(
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 935, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1302, in
_runcommand
    return cmdfunc()
  File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1288, in
<lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1887, in check
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/evolvecmd.py", line
1638, in evolve
    return _performevolve(ui, repo, **opts)
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/evolvecmd.py", line
1726, in _performevolve
    result = solveobswdp(ui, repo, opts)
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/evolvecmd.py", line
1825, in solveobswdp
    splitsucc = utility.select_split_successor(ui, repo, oldctx)
  File "/usr/lib/python3/dist-packages/hgext3rd/evolve/utility.py", line 139,
in select_split_successor
    targets = obsutil.successorssets(repo, ctx.node())[0]
IndexError: list index out of range
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list