# HG changeset patch # User Vadim Gelfer # Date 1149867606 25200 # Node ID 734df6333ca4278a11a663601e33877babf53d47 # Parent 1e80d47b8581b35dfac519b9db9803b022fdf644 add: add -n/--dry-run option diff -r 1e80d47b8581 -r 734df6333ca4 mercurial/commands.py --- a/mercurial/commands.py Thu Jun 08 11:28:27 2006 -0700 +++ b/mercurial/commands.py Fri Jun 09 08:40:06 2006 -0700 @@ -641,7 +641,8 @@ elif repo.dirstate.state(abs) == '?': ui.status(_('adding %s\n') % rel) names.append(abs) - repo.add(names) + if not opts['dry_run']: + repo.add(names) def addremove(ui, repo, *pats, **opts): """add all new files, delete all missing files (DEPRECATED) @@ -2801,7 +2802,8 @@ "^add": (add, [('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 add [OPTION]... [FILE]...')), "debugaddremove|addremove": (addremove,