Mercurial > public > mercurial-scm > hg
comparison tests/test-hgwebdir-paths.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 | 81455f482478 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
43075:57875cf423c9 | 43076:2372284d9457 |
---|---|
3 import os | 3 import os |
4 from mercurial import ( | 4 from mercurial import ( |
5 hg, | 5 hg, |
6 ui as uimod, | 6 ui as uimod, |
7 ) | 7 ) |
8 from mercurial.hgweb import ( | 8 from mercurial.hgweb import hgwebdir_mod |
9 hgwebdir_mod, | 9 |
10 ) | |
11 hgwebdir = hgwebdir_mod.hgwebdir | 10 hgwebdir = hgwebdir_mod.hgwebdir |
12 | 11 |
13 os.mkdir(b'webdir') | 12 os.mkdir(b'webdir') |
14 os.chdir(b'webdir') | 13 os.chdir(b'webdir') |
15 | 14 |
22 hg.repository(u, b'd', create=1) | 21 hg.repository(u, b'd', create=1) |
23 os.chdir(b'..') | 22 os.chdir(b'..') |
24 hg.repository(u, b'c', create=1) | 23 hg.repository(u, b'c', create=1) |
25 os.chdir(b'..') | 24 os.chdir(b'..') |
26 | 25 |
27 paths = {b't/a/': b'%s/a' % webdir, | 26 paths = { |
28 b'b': b'%s/b' % webdir, | 27 b't/a/': b'%s/a' % webdir, |
29 b'coll': b'%s/*' % webdir, | 28 b'b': b'%s/b' % webdir, |
30 b'rcoll': b'%s/**' % webdir} | 29 b'coll': b'%s/*' % webdir, |
30 b'rcoll': b'%s/**' % webdir, | |
31 } | |
31 | 32 |
32 config = os.path.join(webdir, b'hgwebdir.conf') | 33 config = os.path.join(webdir, b'hgwebdir.conf') |
33 configfile = open(config, 'wb') | 34 configfile = open(config, 'wb') |
34 configfile.write(b'[paths]\n') | 35 configfile.write(b'[paths]\n') |
35 for k, v in paths.items(): | 36 for k, v in paths.items(): |