[PATCH V4] remove: add dry-run functionality
Yuya Nishihara
yuya at tcha.org
Wed Mar 28 09:27:16 EDT 2018
On Wed, 28 Mar 2018 18:39:23 +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 4d0b9cc7615ad6bbe505819534a93978d9533461
> # Parent b6a4881cec1937a8d9cd2e9bbbdf5ca31cfa73dd
> remove: add dry-run functionality
>
> diff -r b6a4881cec19 -r 4d0b9cc7615a hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py Sun Mar 18 15:32:49 2018 -0400
> +++ b/hgext/largefiles/overrides.py Wed Mar 21 23:36:11 2018 +0530
> @@ -178,7 +178,7 @@
> added = [f for f in lfnames if f not in bad]
> return added, bad
>
> -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:
> if not after:
> repo.wvfs.unlinkpath(f, ignoremissing=True)
>
> - if opts.get(r'dry_run'):
> + if dryrun:
> return result
There's one more caller of removelargefiles():
+ File "hgext/largefiles/overrides.py", line 1243, in scmutiladdremove
+ removelargefiles(repo.ui, repo, True, m, **pycompat.strkwargs(opts))
+ TypeError: removelargefiles() takes exactly 5 arguments (4 given)
opts.get(r'dry_run') has to be moved to overrides.scmutiladdremove().
Other than that, the patch looks good to me.
More information about the Mercurial-devel
mailing list