Mercurial > hg
diff contrib/dumprevlog @ 43659:99e231afc29c
black: blacken scripts
test-check-format.t doesn't appear to detect Python scripts with shebangs.
But my editor which is configured to auto run black on Python files does
and it appears some files are not blackened.
This commit blackens scripts that need it.
# skip-blame reformatting
Differential Revision: https://phab.mercurial-scm.org/D7420
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 14 Nov 2019 20:35:11 -0800 |
parents | 3518da504303 |
children | 4c1b4805db57 |
line wrap: on
line diff
--- a/contrib/dumprevlog Tue Nov 12 10:17:59 2019 -0500 +++ b/contrib/dumprevlog Thu Nov 14 20:35:11 2019 -0800 @@ -11,23 +11,26 @@ pycompat, revlog, ) -from mercurial.utils import ( - procutil, -) +from mercurial.utils import procutil for fp in (sys.stdin, sys.stdout, sys.stderr): procutil.setbinary(fp) + def binopen(path, mode=b'rb'): if b'b' not in mode: mode = mode + b'b' return open(path, pycompat.sysstr(mode)) + + binopen.options = {} + def printb(data, end=b'\n'): sys.stdout.flush() pycompat.stdout.write(data + end) + for f in sys.argv[1:]: r = revlog.revlog(binopen, encoding.strtolocal(f)) print("file:", f)