Bug 4549 - Repository clone aborts due to missing files
Summary: Repository clone aborts due to missing files
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.3
Hardware: PC Linux
: urgent bug
Assignee: Matt Mackall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 17:22 UTC by Kacper Kowalik
Modified: 2015-03-02 14:39 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 Kacper Kowalik 2015-02-20 17:22 UTC
This happens only with hg 3.3

Steps to reproduce:

 $ hg clone https://bitbucket.org/yt_analysis/yt --debug

Result:
 ...
 couldn't read revision branch cache names: [Errno 2] No such file or directory:   '/tmp/yt/.hg/cache/rbc-names-v1'
 preparing listkeys for "phases"
 sending listkeys command
 checking for updated bookmarks
 adding remote bookmark @
 adding remote bookmark development
 adding remote bookmark experimental
 updating the branch cache
 abort: No such file or directory: /tmp/yt/.hg/store/00changelog.i.a


Same thing happens with that repository served locally via 'hg serve'
Comment 1 Nathan Goldbaum 2015-02-24 03:52 UTC
Bisecting points to 2d54aa5397cd as the source of this regression.
Comment 2 Matt Mackall 2015-02-25 17:56 UTC
Related: bug 4533
Comment 3 kiilerix 2015-02-25 20:29 UTC
The rbc reference is just a debug message and expected in this case.

Repro case with traceabck:
...
adding yt_unstable.kpf revisions
files: 2813/2813 chunks (100.00%)
added 15340 changesets with 33020 changes to 2813 files (+2 heads)
couldn't read revision branch cache names: [Errno 2] No such file or directory: '/tmp/yt/.hg/cache/rbc-names-v1'
preparing listkeys for "phases"
sending listkeys command
checking for updated bookmarks
adding remote bookmark @
adding remote bookmark development
adding remote bookmark experimental
updating the branch cache
Traceback (most recent call last):
  File "/home/mk/hg/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/home/mk/hg/mercurial/dispatch.py", line 860, in _dispatch
    cmdpats, cmdoptions)
  File "/home/mk/hg/mercurial/dispatch.py", line 621, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/mk/hg/mercurial/dispatch.py", line 951, in _runcommand
    return checkargs()
  File "/home/mk/hg/mercurial/dispatch.py", line 922, in checkargs
    return cmdfunc()
  File "/home/mk/hg/mercurial/dispatch.py", line 857, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/home/mk/hg/mercurial/util.py", line 711, in check
    return func(*args, **kwargs)
  File "/home/mk/hg/mercurial/commands.py", line 1374, in clone
    branch=opts.get('branch'))
  File "/home/mk/hg/mercurial/hg.py", line 469, in clone
    bn = destrepo[uprev].branch()
  File "/home/mk/hg/mercurial/context.py", line 514, in branch
    return encoding.tolocal(self._changeset[5].get("branch"))
  File "/home/mk/hg/mercurial/util.py", line 450, in __get__
    result = self.func(obj)
  File "/home/mk/hg/mercurial/context.py", line 483, in _changeset
    return self._repo.changelog.read(self.rev())
  File "/home/mk/hg/mercurial/changelog.py", line 312, in read
    text = self.revision(node)
  File "/home/mk/hg/mercurial/revlog.py", line 1084, in revision
    bins = self._chunks(chain)
  File "/home/mk/hg/mercurial/revlog.py", line 991, in _chunks
    self._chunkraw(revs[0], revs[-1])
  File "/home/mk/hg/mercurial/revlog.py", line 966, in _chunkraw
    return self._getchunk(start, length)
  File "/home/mk/hg/mercurial/revlog.py", line 957, in _getchunk
    return self._loadchunk(offset, length)
  File "/home/mk/hg/mercurial/revlog.py", line 926, in _loadchunk
    df = self.opener(self.indexfile)
  File "/home/mk/hg/mercurial/changelog.py", line 116, in _divert
    return opener(name + ".a", mode)
  File "/home/mk/hg/mercurial/store.py", line 455, in __call__
    return self.vfs(self.encode(path), mode, *args, **kw)
  File "/home/mk/hg/mercurial/scmutil.py", line 424, in __call__
    fp = util.posixfile(f, mode)
IOError: [Errno 2] No such file or directory: '/tmp/yt/.hg/store/00changelog.i.a'
abort: No such file or directory: /tmp/yt/.hg/store/00changelog.i.a
Comment 4 kiilerix 2015-02-25 21:13 UTC
(In reply to comment #1)
> Bisecting points to 2d54aa5397cd as the source of this regression.

For easy reference: http://selenic.com/repo/hg/rev/2d54aa5397cd
"changelog: rely on transaction for finalization"
Comment 5 Matt Mackall 2015-03-02 00:21 UTC
Fix in progress.
Comment 6 HG Bot 2015-03-02 02:00 UTC
Fixed by http://selenic.com/repo/hg/rev/a41902aac76d
Matt Mackall <mpm@selenic.com>
repoview: invalidate cached changelog if _delayed changes (issue4549)

Starting with 2d54aa5397cd, when a clone reached the checkout stage,
the cached changelog in the filtered view was still seeing the
_delayed flag, even though the changelog had already been finalized.

(please test the fix)
Comment 7 Nathan Goldbaum 2015-03-02 14:39 UTC
Tested with hg version 4e865115566e and the problem appears to be fixed.  Thanks for looking at this!