Bug 4490 - KeyError: 'filename' when using new linkrev on a repo with multiple heads and hidden changesets
Summary: KeyError: 'filename' when using new linkrev on a repo with multiple heads and...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: default branch
Hardware: PC Mac OS
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-05 20:24 UTC by Sean Farley
Modified: 2015-01-22 15:04 UTC (History)
3 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 Sean Farley 2015-01-05 20:24 UTC
Steps to reproduce:

$ hg init
$ echo a>>a
$ hg ci -Am0
$ echo b>>b
$ hg ci -Am1
$ echo b>>b
$ hg ci --amend -m 1
$ hg up 0
$ echo c>>c
$ hg ci -Am2
$ hg up 'head() and not .'
$ hg log b
** Unknown exception encountered with possibly-broken third-party extension debugshell
** which supports versions unknown of Mercurial.
** Please disable debugshell and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.9 (default, Dec 13 2014, 15:13:49) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
** Mercurial Distributed SCM (version 3.2.4+531-5ff1c9cbd3db)
** Extensions loaded: transplant, color, patchbomb, schemes, progress, extdiff, rebase, convert, hgk, record, pager, churn, histedit, purge, strip, shelve, debugshell, evolve, hgwatchman, mercurial_keyring, hgsubversion
Traceback (most recent call last):
  File "/Users/sean/projects/hg/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 71, in dispatch
    ret = _runcatch(req)
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 850, in _dispatch
    cmdpats, cmdoptions)
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 611, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Users/sean/projects/hg/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/sean/projects/hg/hgext/pager.py", line 158, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/Users/sean/projects/hg/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/sean/projects/hg/hgext/color.py", line 490, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 941, in _runcommand
    return checkargs()
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 912, in checkargs
    return cmdfunc()
  File "/Users/sean/projects/hg/mercurial/dispatch.py", line 847, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Users/sean/projects/hg/mercurial/util.py", line 702, in check
    return func(*args, **kwargs)
  File "/Users/sean/projects/hg/mercurial/commands.py", line 4447, in log
    revs, expr, filematcher = cmdutil.getlogrevs(repo, pats, opts)
  File "/Users/sean/projects/hg/mercurial/cmdutil.py", line 1901, in getlogrevs
    revs = matcher(repo, revs)
  File "/Users/sean/projects/hg/mercurial/revset.py", line 2176, in mfunc
    result = getset(repo, subset, tree)
  File "/Users/sean/projects/hg/mercurial/revset.py", line 236, in getset
    s = methods[x[0]](repo, subset, *x[1:])
  File "/Users/sean/projects/hg/mercurial/revset.py", line 301, in func
    return symbols[a[1]](repo, subset, b)
  File "/Users/sean/projects/hg/mercurial/revset.py", line 840, in filelog
    fnode = repo[h].manifest()[f]
KeyError: 'b'
Comment 1 Pierre-Yves David 2015-01-05 20:28 UTC
likely caused by 8ec03e0ef51a
Comment 2 Sean Farley 2015-01-05 20:31 UTC
(In reply to comment #1)

Bisect agrees.
Comment 3 HG Bot 2015-01-06 19:30 UTC
Fixed by http://selenic.com/repo/hg/rev/07a6faf939dc
Pierre-Yves David <pierre-yves.david@fb.com>
revset-filelog: handle hidden linkrev for file missing for head (issue4490)

The fix for linkrev pointing to hidden revision was crashing when the file was
missing from head's manifest. We now properly handle this case.

(yes I feel silly)

(please test the fix)
Comment 4 Matt Mackall 2015-01-22 15:04 UTC
Bulk testing -> fixed