Hi, I'm getting following exception while trying to commit changes on fairly large repo. (simply running: hg commit -m "Commit foo") Not sure what or why this is happening, would be great to get some help. ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] ** Mercurial Distributed SCM (version 4.4.1) ** Extensions loaded: convert, purge Traceback (most recent call last): File "/usr/local/bin/hg", line 41, in <module> dispatch.run() File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 85, in run status = (dispatch(req) or 0) & 255 File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 173, in dispatch ret = _runcatch(req) File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 313, in _runcatch return _callcatch(ui, _runcatchfunc) File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 321, in _callcatch return scmutil.callcatch(ui, func) File "/Library/Python/2.7/site-packages/mercurial/scmutil.py", line 154, in callcatch return func() File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 303, in _runcatchfunc return _dispatch(req) File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 940, in _dispatch cmdpats, cmdoptions) File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 701, in runcommand ret = _runcommand(ui, options, cmd, d) File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 948, in _runcommand return cmdfunc() File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 937, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) File "/Library/Python/2.7/site-packages/mercurial/util.py", line 1183, in check return func(*args, **kwargs) File "/Library/Python/2.7/site-packages/mercurial/commands.py", line 1501, in commit return _docommit(ui, repo, *pats, **opts) File "/Library/Python/2.7/site-packages/mercurial/commands.py", line 1584, in _docommit node = cmdutil.commit(ui, repo, commitfunc, pats, opts) File "/Library/Python/2.7/site-packages/mercurial/cmdutil.py", line 3090, in commit return commitfunc(ui, repo, message, matcher, opts) File "/Library/Python/2.7/site-packages/mercurial/commands.py", line 1582, in commitfunc extra=extra) File "/Library/Python/2.7/site-packages/mercurial/localrepo.py", line 142, in wrapper return orig(repo.unfiltered(), *args, **kwargs) File "/Library/Python/2.7/site-packages/mercurial/localrepo.py", line 1946, in commit ret = self.commitctx(cctx, True) File "/Library/Python/2.7/site-packages/mercurial/localrepo.py", line 142, in wrapper return orig(repo.unfiltered(), *args, **kwargs) File "/Library/Python/2.7/site-packages/mercurial/localrepo.py", line 2013, in commitctx trp, changed) File "/Library/Python/2.7/site-packages/mercurial/localrepo.py", line 1778, in _filecommit if fparent2 != nullid or flog.cmp(fparent1, text) or meta: File "/Library/Python/2.7/site-packages/mercurial/filelog.py", line 101, in cmp if self.renamed(node): File "/Library/Python/2.7/site-packages/mercurial/filelog.py", line 65, in renamed return (m["copy"], revlog.bin(m["copyrev"])) KeyError: 'copyrev'
Failing code is: m = parsemeta(t)[0] if m and "copy" in m: return (m["copy"], revlog.bin(m["copyrev"])) This code hasn't meaningfully changed in years. "copy" and "copyrev" are supposed to always occur with each other. So it looks like something changed and is producing "copy" without "copyrev." Alternatively, a 3rd party extension or possibly a bug in `hg convert` could be in play here. But whatever the root cause, "bad" changeset data was recorded somewhere. Anyway, core code should be more defensive here. This should be an easy fix on the stable branch and can be in the 4.4.2 release.
Bug in convert is a possible root cause as this commit is done after pulling converted repo. Do you also track issues related to convert here (cause I have a few of those too) or is it a separate community?
`hg convert` is part of the official Mercurial distribution. So please file bugs in this bug tracker. Use the "convert" component.
Is it clear at this point what the issue is and how to fix it? If so is there some work around or should we wait for a new binary?
Patch on the mailing list: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/108248.html
Bug was set to IN_PROGRESS for 14 days, moving back to confirmed
Bug marked urgent for 10 days, bumping
Bug marked urgent for 11 days, bumping
Looks like the patch for this fell thru the cracks. I just queued it for stable and it will go into the 4.6 release.
Fixed by https://mercurial-scm.org/repo/hg/rev/6614cac550ae Gregory Szorc <gregory.szorc@gmail.com> filelog: don't crash on invalid copy metadata (issue5748) "copy" and "copyrev" are both supposed to appear next to each other. However, a user report demonstrated a crash that indicates that something in the wild is producing "copy" without "copyrev" (probably `hg convert`). While we should definitely fix the source of the bad metadata, the bad code causing the crash is already in the wild and who knows how many repositories are impacted. So let's be more defensive when accessing the file revision metadata. (please test the fix)
Bug was set to TESTING for 7 days, resolving