[issue3076] graft: inaccurate "skipping already grafted revision" error, then crash

Greg Ward bugs at mercurial.selenic.com
Thu Oct 27 14:53:12 CDT 2011

New submission from Greg Ward <greg-hg at gerg.ca>:

A colleague was playing around with graft today as an alternative to our
usual backport mechanism (export, edit, import). He has found at least one
nasty bug. Starting in a brand-new clone that has never seen any graft activity:

$ hg graft -UD 51799b786742 c86f132de32a 14515ff4f862
grafting revision %s114313
grafting revision %s114314
grafting revision %s114316merging 3rd_Party/PacsRuntime/3rdPartyRpms.txt

(Also: the console output is a bit weird!)

So far so good, as near as we can tell. Now we do another graft:

$ hg graft -UD 7c6bb51fbb8c
skipping already grafted revision 114313
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red
Hat 4.5.1-3)]
** Mercurial Distributed SCM (version 2.0-rc+75-6d6b1b9aeea6)
** Extensions loaded: mq, record, extdiff, convert, graphlog, rebase, share,
ims.hg.clonerc, color, purge, patchbomb, transplant, notify, ims.hg.ignore,
ims.hg.bugmap, ims.hg.imshacks, bfiles
Traceback (most recent call last):
  File "/home/bash/scratch/mercurial/hg", line 38, in <module>
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 27,
in run
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 64,
in dispatch
    return _runcatch(req)
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 87,
in _runcatch
    return _dispatch(req)
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 684,
in _dispatch
    cmdpats, cmdoptions)
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 466,
in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/bash/scratch/mercurial-crew/mercurial/extensions.py", line
184, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/hgext/color.py", line 373, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 738,
in _runcommand
    return checkargs()
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 692,
in checkargs
    return cmdfunc()
  File "/home/bash/scratch/mercurial-crew/mercurial/dispatch.py", line 681,
in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/home/bash/scratch/mercurial-crew/mercurial/util.py", line 444, in check
    return func(*args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/mercurial/extensions.py", line
139, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/mercurial/util.py", line 444, in check
    return func(*args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/hgext/mq.py", line 3235, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/mercurial/util.py", line 444, in check
    return func(*args, **kwargs)
  File "/home/bash/scratch/mercurial-crew/mercurial/commands.py", line 2557,
in graft
ValueError: list.remove(x): x not in list
zsh: exit 1     hg graft -UD 7c6bb51fbb8c

Problem #1: it's true that 114313 was already grafted, but why the
complaint? We're not asking to graft it again, but a completely different

Problem #2: it crashed!

We'll try to narrow this down by disabling extensions and maaaaybe cooking
up a test case, but I figured we should get the bug open now.

messages: 17861
nosy: gward, mpm
priority: bug
status: unread
title: graft: inaccurate "skipping already grafted revision" error, then crash
topic: 2.0

Mercurial issue tracker <bugs at mercurial.selenic.com>

More information about the Mercurial-devel mailing list