Bug 2682 - crash in hg annotate
Summary: crash in hg annotate
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 09:49 UTC by Antoine Pitrou
Modified: 2012-05-13 04:50 UTC (History)
6 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 Antoine Pitrou 2011-03-06 09:49 UTC
Do a fresh clone of http://hg.python.org/cpython and then:

$ LANG=C hg ann Lib/test/test_unicode.py 
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.5 (r265:79063, Jul 14 2010, 13:38:11) [GCC 4.4.3]
** Mercurial Distributed SCM (version 1.8+17-fac040b7e822)
** Extensions loaded: children, churn, color, convert, fetch, graphlog, mq,
pager, patchbomb, purge, rebase, transplant, shrink, hgsubversion
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 16,
in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 36,
in dispatch
    return _runcatch(u, args)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 58,
in _runcatch
    return _dispatch(ui, args)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 601,
in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 406,
in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.6/site-packages/mercurial/extensions.py", line
178, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/hgext/pager.py", line 103, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/lib64/python2.6/site-packages/mercurial/extensions.py", line
178, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/hgext/color.py", line 224, in
colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 655,
in _runcommand
    return checkargs()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 609,
in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.6/site-packages/mercurial/dispatch.py", line 598,
in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 433, in
check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/mercurial/extensions.py", line
133, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 433, in
check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/hgext/mq.py", line 3048, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/mercurial/util.py", line 433, in
check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/mercurial/commands.py", line 138,
in annotate
    lines = fctx.annotate(follow=follow, linenumber=linenumber)
  File "/usr/lib64/python2.6/site-packages/mercurial/context.py", line 494,
in annotate
    curr = pair(hist[p], curr)
KeyError: <filectx Lib/test/test_unicode.py@ef28aad3bbae>


Yet the repository seems fine (I hope it is):

$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
9005 files, 68305 changesets, 154561 total revisions

And "hg ann" works fine if I specify a revision:

$ LANG=C hg ann -r tip Lib/test/test_unicode.py
[snip long result]
Comment 1 Matt Mackall 2011-03-06 10:00 UTC
This bug is ancient, but by odd coincidence, I spotted it yesterday.

Bisect traces it back to when we made -f the default for 1.5, but it exists
as far back as 1.0.

It's somehow specific to the topological ordering of the file revlog as I
can trigger it on my local mercurial/localrepo.py but not on copies cloned
from the server.
Comment 2 Matt Mackall 2011-03-06 15:42 UTC
It's caused by crossing linkrevs. Working on a fix.
Comment 3 Patrick Mézard 2011-03-12 06:31 UTC
This was fixed by http://hg.intevation.org/mercurial/crew/rev/7ab85fec60c3
Comment 4 Bugzilla 2012-05-12 09:17 UTC

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

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