Mercurial > hg-stable
diff hgext/narrow/__init__.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 | 687b865b95ad |
line wrap: on
line diff
--- a/hgext/narrow/__init__.py Sat Oct 05 10:29:34 2019 -0400 +++ b/hgext/narrow/__init__.py Sun Oct 06 09:45:02 2019 -0400 @@ -19,9 +19,7 @@ registrar, ) -from mercurial.interfaces import ( - repository, -) +from mercurial.interfaces import repository from . import ( narrowbundle2, @@ -42,17 +40,21 @@ # of this writining in late 2017, all repositories large enough for # ellipsis nodes to be a hard requirement also enforce strictly linear # history for other scaling reasons. -configitem('experimental', 'narrowservebrokenellipses', - default=False, - alias=[('narrow', 'serveellipses')], +configitem( + 'experimental', + 'narrowservebrokenellipses', + default=False, + alias=[('narrow', 'serveellipses')], ) # Export the commands table for Mercurial to see. cmdtable = narrowcommands.table + def featuresetup(ui, features): features.add(repository.NARROW_REQUIREMENT) + def uisetup(ui): """Wraps user-facing mercurial commands with narrow-aware versions.""" localrepo.featuresetupfuncs.add(featuresetup) @@ -60,6 +62,7 @@ narrowcommands.setup() narrowwirepeer.uisetup() + def reposetup(ui, repo): """Wraps local repositories with narrow repo support.""" if not repo.local(): @@ -70,5 +73,6 @@ narrowrepo.wraprepo(repo) narrowwirepeer.reposetup(repo) + templatekeyword = narrowtemplates.templatekeyword revsetpredicate = narrowtemplates.revsetpredicate