Crash in Mercurial 1.0.1

Stefan Sperling stsp at stsp.name
Tue Jun 10 10:01:30 CDT 2008


Hi,

I have just found a way to make Mercurial 1.0.1 crash upon commit.

* rename a file in repository1
* rename it to a different path in repository2 (a clone of repository1)
* pull from repository1 into repository2
* update
* commit

This is with on a FreeBSD-7.0-p1/i386 system, with mercurial-1.0.1
installed from ports. Python is python25-2.5.2_2, also installed from
ports (the _2 is the patch revision of the FreeBSD port).

I don't know if this also exists in the latest development tree.
I have no time to test with the latest code right now. Sorry if
this is a duplicate. I had a quick look over what the bugtracker
returned when I searched for "rename", but I could not see a bug
report title that resembled this (I hope I haven't overlooked anything
though...)

Below is the output of the reproduction script, which is attached,
run with sh -x.

Thanks,
Stefan

+ basename ./hg-1.0.1-update-move-moved-to-bug.sh
+ basename=hg-1.0.1-update-move-moved-to-bug.sh
+ echo hg-1.0.1-update-move-moved-to-bug.sh
+ sed -e s/.sh$//
+ scratch_area=hg-1.0.1-update-move-moved-to-bug
+ repos=hg-1.0.1-update-move-moved-to-bug/repos
+ repos2=hg-1.0.1-update-move-moved-to-bug/repos2
+ set -e
+ rm -rf hg-1.0.1-update-move-moved-to-bug
+ mkdir -p hg-1.0.1-update-move-moved-to-bug/repos
+ echo A
+ hg init hg-1.0.1-update-move-moved-to-bug/repos
+ cd hg-1.0.1-update-move-moved-to-bug/repos
+ hg commit -A -m init
adding A
+ hg clone hg-1.0.1-update-move-moved-to-bug/repos hg-1.0.1-update-move-moved-to-bug/repos2
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ cd hg-1.0.1-update-move-moved-to-bug/repos2
+ hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ hg rename hg-1.0.1-update-move-moved-to-bug/repos/A hg-1.0.1-update-move-moved-to-bug/repos/A.moved
+ hg commit -m moved A to A.moved hg-1.0.1-update-move-moved-to-bug/repos
+ hg rename hg-1.0.1-update-move-moved-to-bug/repos2/A hg-1.0.1-update-move-moved-to-bug/repos2/A.moved2
+ cd hg-1.0.1-update-move-moved-to-bug/repos2
+ hg pull
pulling from /home/stsp/hg-1.0.1-update-move-moved-to-bug/repos
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
+ hg update
warning: detected divergent renames of A to:
 A.moved2
 A.moved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ cd hg-1.0.1-update-move-moved-to-bug/repos2
+ hg commit -m this will crash
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version 1.0.1)
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 20, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 20, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 29, in dispatch
    return _runcatch(u, args)
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 45, in _runcatch
    return _dispatch(ui, args)
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 364, in _dispatch
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 417, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 373, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py", line 356, in <lambda>
    d = lambda: func(ui, repo, *args, **cmdoptions)
  File "/usr/local/lib/python2.5/site-packages/mercurial/commands.py", line 557, in commit
    node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
  File "/usr/local/lib/python2.5/site-packages/mercurial/cmdutil.py", line 1179, in commit
    return commitfunc(ui, repo, files, message, match, opts)
  File "/usr/local/lib/python2.5/site-packages/mercurial/commands.py", line 555, in commitfunc
    force_editor=opts.get('force_editor'))
  File "/usr/local/lib/python2.5/site-packages/hgext/mq.py", line 2189, in commit
    return super(mqrepo, self).commit(*args, **opts)
  File "/usr/local/lib/python2.5/site-packages/mercurial/localrepo.py", line 832, in commit
    new[f] = self.filecommit(f, m1, m2, linkrev, trp, changed)
  File "/usr/local/lib/python2.5/site-packages/mercurial/localrepo.py", line 712, in filecommit
    meta["copyrev"] = hex(manifest1[cp])
KeyError: 'A'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hg-1.0.1-update-move-moved-to-bug.sh
Type: application/x-sh
Size: 672 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080610/1a4a06f1/attachment.sh 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080610/1a4a06f1/attachment.pgp 


More information about the Mercurial mailing list