Mercurial > public > mercurial-scm > hg-stable
diff tests/pullext.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 | 268662aac075 |
children | 9f70512ae2cf |
line wrap: on
line diff
--- a/tests/pullext.py Sat Oct 05 10:29:34 2019 -0400 +++ b/tests/pullext.py Sun Oct 06 09:45:02 2019 -0400 @@ -14,9 +14,8 @@ extensions, localrepo, ) -from mercurial.interfaces import ( - repository, -) +from mercurial.interfaces import repository + def clonecommand(orig, ui, repo, *args, **kwargs): if kwargs.get(r'include') or kwargs.get(r'exclude'): @@ -30,9 +29,11 @@ return orig(ui, repo, *args, **kwargs) + def featuresetup(ui, features): features.add(repository.NARROW_REQUIREMENT) + def extsetup(ui): entry = extensions.wrapcommand(commands.table, b'clone', clonecommand) @@ -40,13 +41,16 @@ hasdepth = any(x[1] == b'depth' for x in entry[1]) if not hasinclude: - entry[1].append((b'', b'include', [], - _(b'pattern of file/directory to clone'))) - entry[1].append((b'', b'exclude', [], - _(b'pattern of file/directory to not clone'))) + entry[1].append( + (b'', b'include', [], _(b'pattern of file/directory to clone')) + ) + entry[1].append( + (b'', b'exclude', [], _(b'pattern of file/directory to not clone')) + ) if not hasdepth: - entry[1].append((b'', b'depth', b'', - _(b'ancestry depth of changesets to fetch'))) + entry[1].append( + (b'', b'depth', b'', _(b'ancestry depth of changesets to fetch')) + ) localrepo.featuresetupfuncs.add(featuresetup)