Mercurial > hg-stable
diff tests/printrevset.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 | a271466cb53a |
children | a717de1cb624 |
line wrap: on
line diff
--- a/tests/printrevset.py Sat Oct 05 10:29:34 2019 -0400 +++ b/tests/printrevset.py Sun Oct 06 09:45:02 2019 -0400 @@ -1,16 +1,15 @@ from __future__ import absolute_import from mercurial import ( - cmdutil, - commands, - extensions, - logcmdutil, - revsetlang, - smartset, + cmdutil, + commands, + extensions, + logcmdutil, + revsetlang, + smartset, ) -from mercurial.utils import ( - stringutil, -) +from mercurial.utils import stringutil + def logrevset(repo, pats, opts): revs = logcmdutil._initialrevs(repo, opts) @@ -19,6 +18,7 @@ match, pats, slowpath = logcmdutil._makematcher(repo, revs, pats, opts) return logcmdutil._makerevset(repo, match, pats, slowpath, opts) + def uisetup(ui): def printrevset(orig, repo, pats, opts): revs, filematcher = orig(repo, pats, opts) @@ -35,7 +35,14 @@ ui.write(stringutil.prettyrepr(revs) + b'\n') revs = smartset.baseset() # display no revisions return revs, filematcher + extensions.wrapfunction(logcmdutil, 'getrevs', printrevset) aliases, entry = cmdutil.findcmd(b'log', commands.table) - entry[1].append((b'', b'print-revset', False, - b'print generated revset and exit (DEPRECATED)')) + entry[1].append( + ( + b'', + b'print-revset', + False, + b'print generated revset and exit (DEPRECATED)', + ) + )