Bug 2364 - Crash during update when working directory contains files of target version
Summary: Crash during update when working directory contains files of target version
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: urgent bug
Assignee: Matt Mackall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 13:41 UTC by Thomas Arendsen Hein
Modified: 2010-11-01 04:32 UTC (History)
8 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Arendsen Hein 2010-09-06 13:41 UTC
Crash when updating to an older version when the working directory already
contains files of that version.

To reproduce:
- clone of current crew repository, checkout of any recent revision should
work, 74f54b7775f2 (current tip) definitely does

$ hg revert -r 288dda59233c templates
$ hg co 288dda59233c
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14) [GCC 4.3.2]
** Mercurial Distributed SCM (version 1.6.3+19-581066a319e5)
** Extensions loaded: 
Traceback (most recent call last):
  File "/home/thomas/bin/hg-tah", line 19, in <module>
    mercurial.dispatch.run()
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 34, in dispatch
    return _runcatch(u, args)
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 54, in _runcatch
    return _dispatch(ui, args)
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 494, in _dispatch
    cmdpats, cmdoptions)
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 355, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 545, in
_runcommand
    return checkargs()
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 499, in checkargs
    return cmdfunc()
  File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 492, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/home/thomas/hg/repos/tah/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/home/thomas/hg/repos/tah/mercurial/commands.py", line 3851, in update
    return hg.update(repo, rev)
  File "/home/thomas/hg/repos/tah/mercurial/hg.py", line 381, in update
    stats = mergemod.update(repo, node, False, False, None)
  File "/home/thomas/hg/repos/tah/mercurial/merge.py", line 521, in update
    stats = applyupdates(repo, action, wc, p2, pa)
  File "/home/thomas/hg/repos/tah/mercurial/merge.py", line 274, in applyupdates
    fca = fcl.parents()[0]
IndexError: list index out of range
Comment 1 Thomas Arendsen Hein 2010-09-06 13:48 UTC
not reproducible with 1.5 and 1.5.4
Comment 2 Thomas Arendsen Hein 2010-09-06 13:56 UTC
Result of bisect is, that the problem was introduced between 1.6.2 and 1.6.3.

The first bad revision is:
changeset:   12008:fad5ed0ff997
branch:      stable
parent:      12005:c6b1be675d3c
user:        Matt Mackall <mpm@selenic.com>
date:        Sat Aug 21 10:41:29 2010 -0500
summary:     merge: move reverse-merge logic out of filemerge (issue2342)
Comment 3 Thomas Arendsen Hein 2010-09-06 13:59 UTC
Upgrading to urgent, because this is a regression in stable.
(not critical, because no data loss happens)
Comment 4 Thomas Arendsen Hein 2010-10-06 01:34 UTC
hynekcer reported the same in issue2422 (exception IndexError in update
after revert)
Comment 5 HG Bot 2010-10-09 15:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/545ec1775021
Matt Mackall <mpm@selenic.com>
merge: handle no file parent in backwards merge (issue2364)
Comment 6 Thomas Arendsen Hein 2010-11-01 04:32 UTC
works for me, tested with 53cfde2b3cf9 (nearly 1.7)
Comment 7 Bugzilla 2012-05-12 09:12 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:12 EDT  ---

This bug was previously known as _bug_ 2364 at http://mercurial.selenic.com/bts/issue2364