--- 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