# HG changeset patch # User Vadim Gelfer # Date 1149868110 25200 # Node ID c1ec813198706297f572e977851ab7716f68266c # Parent e5cb39577b9f105651b80ad351ac959285034f1c copy: add -n/--dry-run option diff -r e5cb39577b9f -r c1ec81319870 mercurial/commands.py --- a/mercurial/commands.py Fri Jun 09 08:42:36 2006 -0700 +++ b/mercurial/commands.py Fri Jun 09 08:48:30 2006 -0700 @@ -1172,9 +1172,10 @@ if not copylist: raise util.Abort(_('no files to copy')) - for targetpath, srcs in copylist: - for origsrc, abssrc, relsrc, exact in srcs: - copy(origsrc, abssrc, relsrc, targetpath(abssrc), exact) + if not opts.get('dry_run'): + for targetpath, srcs in copylist: + for origsrc, abssrc, relsrc, exact in srcs: + copy(origsrc, abssrc, relsrc, targetpath(abssrc), exact) if errors: ui.warn(_('(consider using --after)\n')) @@ -2882,7 +2883,8 @@ ('f', 'force', None, _('forcibly copy over an existing managed file')), ('I', 'include', [], _('include names matching the given patterns')), - ('X', 'exclude', [], _('exclude names matching the given patterns'))], + ('X', 'exclude', [], _('exclude names matching the given patterns')), + ('n', 'dry-run', None, _('print what would be done'))], _('hg copy [OPTION]... [SOURCE]... DEST')), "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')), "debugcomplete":