Mercurial > hg-stable
diff hgext/purge.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | c303d65d2e34 |
children | 687b865b95ad |
line wrap: on
line diff
--- a/hgext/purge.py Sat Oct 05 10:29:34 2019 -0400 +++ b/hgext/purge.py Sun Oct 06 09:45:02 2019 -0400 @@ -42,17 +42,29 @@ # leave the attribute unspecified. testedwith = 'ships-with-hg-core' -@command('purge|clean', - [('a', 'abort-on-err', None, _('abort if an error occurs')), - ('', 'all', None, _('purge ignored files too')), - ('', 'dirs', None, _('purge empty directories')), - ('', 'files', None, _('purge files')), - ('p', 'print', None, _('print filenames instead of deleting them')), - ('0', 'print0', None, _('end filenames with NUL, for use with xargs' - ' (implies -p/--print)')), - ] + cmdutil.walkopts, + +@command( + 'purge|clean', + [ + ('a', 'abort-on-err', None, _('abort if an error occurs')), + ('', 'all', None, _('purge ignored files too')), + ('', 'dirs', None, _('purge empty directories')), + ('', 'files', None, _('purge files')), + ('p', 'print', None, _('print filenames instead of deleting them')), + ( + '0', + 'print0', + None, + _( + 'end filenames with NUL, for use with xargs' + ' (implies -p/--print)' + ), + ), + ] + + cmdutil.walkopts, _('hg purge [OPTION]... [DIR]...'), - helpcategory=command.CATEGORY_MAINTENANCE) + helpcategory=command.CATEGORY_MAINTENANCE, +) def purge(ui, repo, *dirs, **opts): '''removes files not tracked by Mercurial @@ -89,7 +101,7 @@ eol = '\n' if opts.get('print0'): eol = '\0' - act = False # --print0 implies --print + act = False # --print0 implies --print removefiles = opts.get('files') removedirs = opts.get('dirs') @@ -101,10 +113,14 @@ match = scmutil.match(repo[None], dirs, opts) paths = mergemod.purge( - repo, match, ignored=opts.get('all', False), - removeemptydirs=removedirs, removefiles=removefiles, + repo, + match, + ignored=opts.get('all', False), + removeemptydirs=removedirs, + removefiles=removefiles, abortonerror=opts.get('abort_on_err'), - noop=not act) + noop=not act, + ) for path in paths: if not act: