Bug 4499 - "hg log $file" results in "abort: hidden revision '28300'!"
Summary: "hg log $file" results in "abort: hidden revision '28300'!"
Status: VERIFIED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: evolution (show other bugs)
Version: default branch
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-12 14:11 UTC by Martin von Zweigbergk
Modified: 2015-01-15 00:06 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 Martin von Zweigbergk 2015-01-12 14:11 UTC
With the current default branch (version 3.2.4+587-678f53865c68), I get this:

$ hg log mercurial/merge.py
abort: hidden revision '28300'!

28300 is another name for f487 below

$ hg --hidden ll
o  4e49 martinvonz tip
|  merge: structure 'remote created' code to match table
| x  f487 martinvonz
|/   merge: structure 'remote created' code to match table
| o  1bf6 martinvonz  fix-revert-matcher-files
| |  matcher: matching e.g. 'relpath:.' means always matching
| | x  70bb martinvonz
| | |  merge: move calculateupdates() closer to manifestmerge()
| | | x  6ff3a martinvonz
| | | |  largefiles: use clearer debug messages in actions
| +---x  16fe6 martinvonz
| | |    largefiles: don't clobber merge action message with user message
| | | x  7cb1 martinvonz
| | | |  draft
o | | |  210ed martinvonz
|/ / /   merge: introduce 'c' action for 'remote created'
| | | x  69875 martinvonz
| | | |  temporary amend commit for 0b234fe473d2
+-----x  0b23 martinvonz

The repo has been stripped to simplify it after problem first appeared.
Comment 1 Matt Mackall 2015-01-13 03:00 UTC
Was this present before PyD's recent linkrev changes?
Comment 2 Pierre-Yves David 2015-01-13 03:03 UTC
definitly related to my recent change. The crash is in the new code. Some value happen to get added to a dict it should not, leading to a crash later on.

Will investigate when done writing reviews.
Comment 3 Martin von Zweigbergk 2015-01-13 11:47 UTC
Speaking of "The crash is in the new code.", I should have included a stack trace (I did only on IRC before). Here it is:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 850, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 611, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/hgext/pager.py", line 158, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/hgext/color.py", line 491, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 941, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 912, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 847, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 702, in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 4459, in log
    revs, expr, filematcher = cmdutil.getlogrevs(repo, pats, opts)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/cmdutil.py", line 1907, in getlogrevs
    revs = matcher(repo, revs)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/revset.py", line 2214, in mfunc
    result = getset(repo, subset, tree)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/revset.py", line 241, in getset
    s = methods[x[0]](repo, subset, *x[1:])
  File "/usr/local/lib/python2.7/dist-packages/mercurial/revset.py", line 306, in func
    return symbols[a[1]](repo, subset, b)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/revset.py", line 868, in filelog
    for p in repo[childcrev][f].parents():
  File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 461, in __getitem__
    return context.changectx(self, changeid)
  File "/usr/local/lib/python2.7/dist-packages/mercurial/context.py", line 498, in __init__
    raise error.FilteredRepoLookupError(msg, hint=hint)
FilteredRepoLookupError: hidden revision '28300'
Comment 4 Martin von Zweigbergk 2015-01-13 11:52 UTC
And I should also have bisected it; sorry. The changeset that introduced this bug is http://selenic.com/hg/rev/8ec03e0ef51a.
Comment 5 Martin von Zweigbergk 2015-01-14 13:01 UTC
I've managed to reduce it down to this:

@  23379:4e4910106f8f merge: structure 'remote created' code to match table
|
| x  23378:f48700b3f844 merge: structure 'remote created' code to match table
|/
o  23377:210ed1255004 merge: introduce 'c' action for 'remote created'
|
| x  23376:0b234fe473d2 merge: introduce 'c' action for 'remote created'
|/
o  23375:a179db3db9b9 dirstate: speed up repeated missing directory checks


$ hg log mercurial/merge.py
abort: hidden revision '23378'!

I've confirmed that f48700b3f844 got obsoleted by 4e4910106f8f, and 0b234fe473d2 got obsoleted by 210ed1255004.

I'll dig into the code now.
Comment 6 Pierre-Yves David 2015-01-14 20:03 UTC
The bug comes from the readdelta function on manifest being very literal and
returning the actually stored delta that could be stored againts an arbitrary
base.

The following test:

  Check proper report when the manifest changes but not the file
  
    $ hg init issue4499
    $ cd issue4499
    $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
    >     echo 1 > $f;
    >     hg add $f;
    > done
    $ hg commit -m 'A1B1C1'
    $ echo 2 > A
    $ echo 2 > B
    $ echo 2 > C
    $ hg commit -m 'A2B2C2'
    $ hg up 0
    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    $ echo 3 > A
    $ echo 2 > B
    $ echo 2 > C
    $ hg commit -m 'A3B2C2'
    created new head
  
    $ hg log -G
    @  changeset:   2:fe5fc3d0eb17
    |  tag:         tip
    |  parent:      0:abf4f0e38563
    |  user:        test
    |  date:        Thu Jan 01 00:00:00 1970 +0000
    |  summary:     A3B2C2
    |
    | o  changeset:   1:07dcc6b312c0
    |/   user:        test
    |    date:        Thu Jan 01 00:00:00 1970 +0000
    |    summary:     A2B2C2
    |
    o  changeset:   0:abf4f0e38563
       user:        test
       date:        Thu Jan 01 00:00:00 1970 +0000
       summary:     A1B1C1
    
  
  Log -f on B should reports current changesets
  
    $ hg log -fG B
    @  changeset:   2:fe5fc3d0eb17
    |  tag:         tip
    |  parent:      0:abf4f0e38563
    |  user:        test
    |  date:        Thu Jan 01 00:00:00 1970 +0000
    |  summary:     A3B2C2
    |
    o  changeset:   0:abf4f0e38563
       user:        test
       date:        Thu Jan 01 00:00:00 1970 +0000
       summary:     A1B1C1
    
    $ cd ..

Fails that way:

 Log -f on B should reports current changesets
 
   $ hg log -fG B
-  @  changeset:   2:fe5fc3d0eb17
-  |  tag:         tip
-  |  parent:      0:abf4f0e38563
+  o  changeset:   1:07dcc6b312c0
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     A3B2C2
+  |  summary:     A2B2C2
   |
   o  changeset:   0:abf4f0e38563
      user:        test
Comment 7 HG Bot 2015-01-14 20:45 UTC
Fixed by http://selenic.com/repo/hg/rev/81349f4b47f4
Pierre-Yves David <pierre-yves.david@fb.com>
linkrev: use the right manifest content when adjusting linrev (issue4499)

When the manifest revision is stored as a delta against a non-parent revision,
'_adjustlinkrev' could miss some file update because it was using the delta
only. We now use the 'fastread' method that uses the delta only when it makes
sense.

A test showcasing on the of possible issue have been added.

(please test the fix)
Comment 8 Martin von Zweigbergk 2015-01-15 00:06 UTC
It works! Thanks!