Issue1237

Title hg crashes when commiting
Priority bug Status resolved
Superseder KeyError for copy in commit
View: 1175
Nosy List mpm, phil
Assigned To Topics

Created on 2008-07-23.16:48:00 by phil, last changed 2008-08-02.19:56:08 by pmezard.

Messages
msg6573 (view) Author: mpm Date: 2008-07-24.19:08:27
Note that it crashes on exactly the same line. Re-closing.

The question is not whether the files are present in the working directory, but
in the manifest of the first parent:

    meta["copyrev"] = hex(manifest1[cp])
KeyError: 'import_stuff'

Here, we're looking up the file revision of import_stuff that our copy is based
on. But our parent revision has never heard of it. Since we don't record copy
info for files that aren't tracked. the parent revision must have changed (via
update/merge/etc.) after the copy/rename.
msg6566 (view) Author: phil Date: 2008-07-24.15:45:59
If I understood correctly issue1175, this is not the same bug. I never did
anything other than commiting on this repository. Moreover, all files scheduled
for addition are present, no file is reported missing, so the workarround does
not apply.
msg6558 (view) Author: mpm Date: 2008-07-23.16:58:21
Duplicate, closing
msg6557 (view) Author: mpm Date: 2008-07-23.16:55:12
This is a known bug with copying a file and then doing a linear update to a
revision without the file. Mercurial remembers the copy but forgets what version
of the source it was supposed to record since it's no longer in the parent.

We don't have a fix yet. But you can work around it by updating back to before
the source file was deleted, committing, and then merging.

(Workaround exists, degrading to bug)
msg6556 (view) Author: phil Date: 2008-07-23.16:48:00
"import_stuff" (last line) is the name of a patch. hg verify on .hg/patches says
nothing. (and hg commit on .hg/patches crashes in the same way, obiously)

$ hg qcommit
transaction abort!
rollback completed
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.0.1)
Traceback (most recent call last):
  File "/usr/bin/hg", line 20, in <module>
    mercurial.dispatch.run()
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 20, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 29, in
dispatch
    return _runcatch(u, args)
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 45, in
_runcatch
    return _dispatch(ui, args)
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 364, in
_dispatch
    ret = _runcommand(ui, options, cmd, d)
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 417, in
_runcommand
    return checkargs()
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 373, in
checkargs
    return cmdfunc()
  File "/var/lib/python-support/python2.5/mercurial/dispatch.py", line 356, in
<lambda>
    d = lambda: func(ui, repo, *args, **cmdoptions)
  File "/var/lib/python-support/python2.5/hgext/mq.py", line 1651, in commit
    commands.commit(r.ui, r, *pats, **opts)
  File "/var/lib/python-support/python2.5/mercurial/commands.py", line 557, in
commit
    node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
  File "/var/lib/python-support/python2.5/mercurial/cmdutil.py", line 1179, in
commit
    return commitfunc(ui, repo, files, message, match, opts)
  File "/var/lib/python-support/python2.5/mercurial/commands.py", line 555, in
commitfunc
    force_editor=opts.get('force_editor'))
  File "/var/lib/python-support/python2.5/hgext/mq.py", line 2189, in commit
    return super(mqrepo, self).commit(*args, **opts)
  File "/var/lib/python-support/python2.5/mercurial/localrepo.py", line 832, in
commit
    new[f] = self.filecommit(f, m1, m2, linkrev, trp, changed)
  File "/var/lib/python-support/python2.5/mercurial/localrepo.py", line 712, in
filecommit
    meta["copyrev"] = hex(manifest1[cp])
KeyError: 'import_stuff'
History
Date User Action Args
2008-08-02 19:56:08pmezardsetstatus: chatting -> resolved
2008-07-24 19:08:28mpmsetstatus: chatting
messages: + msg6573
2008-07-24 15:46:01philsetstatus: resolved -> (no value)
messages: + msg6566
2008-07-23 16:58:21mpmsetstatus: chatting -> resolved
superseder: + KeyError for copy in commit
messages: + msg6558
2008-07-23 16:55:12mpmsetpriority: urgent -> bug
nosy: + mpm
status: unread -> chatting
messages: + msg6557
2008-07-23 16:48:00philcreate