[Bug 5309] New: When editing a hunk and removing all lines, IndexError: list index out of range occurs

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Jul 21 08:13:50 UTC 2016


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

            Bug ID: 5309
           Summary: When editing a hunk and removing all lines,
                    IndexError: list index out of range occurs
           Product: Mercurial
           Version: 3.8.4
          Hardware: Macintosh
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: record
          Assignee: bugzilla at selenic.com
          Reporter: philipp at bugzilla.kewis.ch
                CC: mercurial-devel at selenic.com

STR:

1) Start selecting with hg record (great interface, btw!)
2) Select a hunk and press "e" to edit
3) Decide to cancel by removing all lines in the editor

Expected:

* The hunk is not modified and retains its previous state

Actual:

$ hg record
starting interactive selection
** Unknown exception encountered with possibly-broken third-party extension
bugzilla
** which supports versions unknown of Mercurial.
** Please disable bugzilla and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.11 (default, Apr 18 2016, 09:08:13) [GCC 4.2.1 Compatible Apple
LLVM 7.3.0 (clang-703.0.29)]
** Mercurial Distributed SCM (version 3.8.4)
** Extensions loaded: strip, mq, bugzilla, backport, try-mc, transplant,
rebase, qimportbz, graphlog, qseriese, purge, record, color, histedit, pager,
qbackout, bundleclone, reviewboard, evolve, firefoxtree, share, shelve,
blackbox
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 59,
in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
125, in dispatch
    ret = _runcatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
204, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
887, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
632, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line
204, in closure
    return func(*(args + a), **kw)
  File "/usr/local/lib/python2.7/site-packages/hgext/pager.py", line 160, in
pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line
204, in closure
    return func(*(args + a), **kw)
  File "/usr/local/lib/python2.7/site-packages/hgext/color.py", line 502, in
colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
1017, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
978, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
884, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 1005,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line
204, in closure
    return func(*(args + a), **kw)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 1005,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/hgext/mq.py", line 3519, in
mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 1005,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/hgext/record.py", line 73, in
record
    commands.commit(ui, repo, *pats, **opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line
1682, in commit
    return _docommit(ui, repo, *pats, **opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line
1690, in _docommit
    cmdutil.recordfilter, *pats, **opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 287,
in dorecord
    return commit(ui, repo, recordinwlock, pats, opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line
2621, in commit
    return commitfunc(ui, repo, message, matcher, opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 285,
in recordinwlock
    return recordfunc(ui, repo, message, match, opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 165,
in recordfunc
    chunks, newopts = filterfn(ui, originalchunks)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 103,
in recordfilter
    testfile, operation)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 86,
in filterchunks
    return crecordmod.filterpatch(ui, originalhunks, recordfn, operation)
  File "/usr/local/lib/python2.7/site-packages/mercurial/crecord.py", line 477,
in filterpatch
    ret = chunkselector(ui, uiheaders)
  File "/usr/local/lib/python2.7/site-packages/mercurial/crecord.py", line 517,
in chunkselector
    curses.wrapper(chunkselector.main)
  File
"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py",
line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/site-packages/mercurial/crecord.py", line
1677, in main
    if self.handlekeypressed(keypressed):
  File "/usr/local/lib/python2.7/site-packages/mercurial/crecord.py", line
1613, in handlekeypressed
    self.toggleedit(test=test)
  File "/usr/local/lib/python2.7/site-packages/mercurial/crecord.py", line
1544, in toggleedit
    newpatchheader = newpatches[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