diff mercurial/commands.py @ 37153:335e19c6b7fa

remove: add dry-run functionality
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Wed, 21 Mar 2018 23:36:11 +0530
parents bb141aa54728
children 0348c778bf70
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Mar 17 01:53:44 2018 -0400
+++ b/mercurial/commands.py	Wed Mar 21 23:36:11 2018 +0530
@@ -4213,7 +4213,7 @@
     [('A', 'after', None, _('record delete for missing files')),
     ('f', 'force', None,
      _('forget added files, delete modified files')),
-    ] + subrepoopts + walkopts,
+    ] + subrepoopts + walkopts + dryrunopts,
     _('[OPTION]... FILE...'),
     inferrepo=True)
 def remove(ui, repo, *pats, **opts):
@@ -4257,12 +4257,14 @@
 
     opts = pycompat.byteskwargs(opts)
     after, force = opts.get('after'), opts.get('force')
+    dryrun = opts.get('dry_run')
     if not pats and not after:
         raise error.Abort(_('no files specified'))
 
     m = scmutil.match(repo[None], pats, opts)
     subrepos = opts.get('subrepos')
-    return cmdutil.remove(ui, repo, m, "", after, force, subrepos)
+    return cmdutil.remove(ui, repo, m, "", after, force, subrepos,
+                          dryrun=dryrun)
 
 @command('rename|move|mv',
     [('A', 'after', None, _('record a rename that has already occurred')),