diff -r e03d8a40521f -r 79fecd735d26 mercurial/commands.py --- a/mercurial/commands.py Fri Apr 06 16:18:33 2012 +0300 +++ b/mercurial/commands.py Tue Apr 10 12:49:12 2012 -0500 @@ -2492,7 +2492,7 @@ _('record the current date as commit date')), ('U', 'currentuser', False, _('record the current user as committer'), _('DATE'))] - + commitopts2 + mergetoolopts, + + commitopts2 + mergetoolopts + dryrunopts, _('[OPTION]... REVISION...')) def graft(ui, repo, *revs, **opts): '''copy changes from other branches onto the current branch @@ -2611,7 +2611,10 @@ for pos, ctx in enumerate(repo.set("%ld", revs)): current = repo['.'] + ui.status(_('grafting revision %s\n') % ctx.rev()) + if opts.get('dry_run'): + continue # we don't merge the first commit when continuing if not cont: @@ -2654,7 +2657,7 @@ date=date, extra=extra, editor=editor) # remove state when we complete successfully - if os.path.exists(repo.join('graftstate')): + if not opts.get('dry_run') and os.path.exists(repo.join('graftstate')): util.unlinkpath(repo.join('graftstate')) return 0