[Bug 5801] New: pure-python manifest code produces corrupt unsorted manifests

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Feb 22 16:57:15 UTC 2018


https://bz.mercurial-scm.org/show_bug.cgi?id=5801

            Bug ID: 5801
           Summary: pure-python manifest code produces corrupt unsorted
                    manifests
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: durin42 at gmail.com
                CC: mercurial-devel at mercurial-scm.org

The only steps to reproduce I have right now involve a repo from timeless
that's a conversion of hg-git, but I can reliably build a corrupt commit with a
merge of two revisions if I use HGMODULEPOLICY=py. If I use HGMODULEPOLICY=c,
the problem doesn't happen.

This does appear to be rare, and the resulting manifest can't even be checked
out so it's obvious *right away* something is borked, but we should still
address this promptly, probably with backports to older versions...

Here's the traceback:

Traceback (most recent call last):
  File "/opt/hg/bin/hg", line 41, in <module>
    dispatch.run()
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 88, in run
    status = (dispatch(req) or 0) & 255
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 183, in dispatch
    ret = _runcatch(req)
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 324, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 332, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/opt/hg/lib/python/mercurial/scmutil.py", line 154, in callcatch
    return func()
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 314, in _runcatchfunc
    return _dispatch(req)
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 917, in _dispatch
    cmdpats, cmdoptions)
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 674, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 925, in _runcommand
    return cmdfunc()
  File "/opt/hg/lib/python/mercurial/dispatch.py", line 914, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/opt/hg/lib/python/mercurial/util.py", line 1228, in check
    return func(*args, **kwargs)
  File "/opt/hg/lib/python/mercurial/util.py", line 1228, in check
    return func(*args, **kwargs)
  File "/opt/hg/lib/python/hgext/mq.py", line 3590, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/opt/hg/lib/python/mercurial/util.py", line 1228, in check
    return func(*args, **kwargs)
  File "/opt/hg/lib/python/mercurial/commands.py", line 1963, in export
    opts=patch.diffallopts(ui, opts))
  File "/opt/hg/lib/python/mercurial/cmdutil.py", line 1555, in export
    repo, ctx, match, switch_parent, rev, seqno, write, opts)
  File "/opt/hg/lib/python/mercurial/cmdutil.py", line 1499, in _exportsingle
    for chunk, label in patch.diffui(repo, prev, node, match, opts=diffopts):
  File "/opt/hg/lib/python/mercurial/patch.py", line 2486, in difflabel
    for chunk in func(*args, **kw):
  File "/opt/hg/lib/python/mercurial/patch.py", line 2339, in diff
    losedatafn=losedatafn, prefix=prefix, relroot=relroot, copy=copy,
  File "/opt/hg/lib/python/mercurial/patch.py", line 2396, in diffhunks
    changes = repo.status(ctx1, ctx2, match=match)
  File "/opt/hg/lib/python/mercurial/localrepo.py", line 2055, in status
    listsubrepos)
  File "/opt/hg/lib/python/mercurial/context.py", line 362, in status
    listunknown)
  File "/opt/hg/lib/python/mercurial/context.py", line 131, in _buildstatus
    mf2 = self._buildstatusmanifest(s)
  File "/opt/hg/lib/python/mercurial/context.py", line 109, in
_buildstatusmanifest
    return self.manifest()
  File "/opt/hg/lib/python/mercurial/context.py", line 189, in manifest
    return self._manifest
  File "/opt/hg/lib/python/mercurial/util.py", line 966, in __get__
    result = self.func(obj)
  File "/opt/hg/lib/python/mercurial/context.py", line 547, in _manifest
    return self._manifestctx.read()
  File "/opt/hg/lib/python/mercurial/manifest.py", line 1471, in read
    self._data = manifestdict(text)
  File "/opt/hg/lib/python/mercurial/manifest.py", line 423, in __init__
    self._lm = _lazymanifest(data)
ValueError: Manifest lines not in sorted order.

(from running `hg export` on a thusly corrupt revision)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list