[PATCH V4] remove: add dry-run functionality

Yuya Nishihara yuya at tcha.org
Thu Mar 29 07:41:02 EDT 2018


On Wed, 28 Mar 2018 22:22:14 +0530, Sushil khanchi wrote:
> # HG changeset patch
> # User Sushil khanchi <sushilkhanchi97 at gmail.com>
> # Date 1521655571 -19800
> #      Wed Mar 21 23:36:11 2018 +0530
> # Node ID d4a3c5969df336e556463a1b0b49132dc907f536
> # Parent  b6a4881cec1937a8d9cd2e9bbbdf5ca31cfa73dd
> remove: add dry-run functionality

> -def removelargefiles(ui, repo, isaddremove, matcher, **opts):
> +def removelargefiles(ui, repo, isaddremove, matcher, dryrun, **opts):
>      after = opts.get(r'after')
>      m = composelargefilematcher(matcher, repo[None].manifest())
>      try:
> @@ -223,11 +223,11 @@
>                      name = m.rel(f)
>                  ui.status(_('removing %s\n') % name)
>  
> -            if not opts.get(r'dry_run'):
> +            if not dryrun:

[...]

>  def overridestatusfn(orig, repo, rev2, **opts):
> @@ -1238,7 +1240,7 @@
>          matchfn = m.matchfn
>          m.matchfn = lambda f: f in s.deleted and matchfn(f)
>  
> -        removelargefiles(repo.ui, repo, True, m, **pycompat.strkwargs(opts))
> +        removelargefiles(repo.ui, repo, True, m, dry_run, **pycompat.strkwargs(opts))

Well, dry_run does not always equal to opts.get('dry_run').

Perhaps opts should be removed from scmutil.addremove(), but that's out
of the scope of this patch.


More information about the Mercurial-devel mailing list