diff -r 69d4c8c5c25e -r 3bc2e550f2bd mercurial/commands.py --- a/mercurial/commands.py Fri Nov 16 18:37:26 2018 -0500 +++ b/mercurial/commands.py Thu Nov 15 22:59:38 2018 +0900 @@ -2478,10 +2478,11 @@ revs.remove(ids[n]) elif ctx.hex() in ids: r = ids[ctx.hex()] - ui.warn(_('skipping already grafted revision %d:%s ' - '(was grafted from %d:%s)\n') % - (r, repo[r], rev, ctx)) - revs.remove(r) + if r in revs: + ui.warn(_('skipping already grafted revision %d:%s ' + '(was grafted from %d:%s)\n') % + (r, repo[r], rev, ctx)) + revs.remove(r) if not revs: return -1