changeset 2412:e5cb39577b9f

addremove: add -n/--dry-run option
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 09 Jun 2006 08:42:36 -0700
parents 734df6333ca4
children c1ec81319870
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Jun 09 08:40:06 2006 -0700
+++ b/mercurial/commands.py	Fri Jun 09 08:42:36 2006 -0700
@@ -671,8 +671,9 @@
             remove.append(abs)
             if ui.verbose or not exact:
                 ui.status(_('removing %s\n') % ((pats and rel) or abs))
-    repo.add(add, wlock=wlock)
-    repo.remove(remove, wlock=wlock)
+    if not opts.get('dry_run'):
+        repo.add(add, wlock=wlock)
+        repo.remove(remove, wlock=wlock)
 
 def annotate(ui, repo, *pats, **opts):
     """show changeset information per file line
@@ -2808,7 +2809,8 @@
     "debugaddremove|addremove":
         (addremove,
          [('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 addremove [OPTION]... [FILE]...')),
     "^annotate":
         (annotate,