Mercurial > hg
comparison setup.py @ 44452:9d2b2df2c2ba
cleanup: run pyupgrade on our source tree to clean up varying things
Built with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**' | xargs pyupgrade --keep-percent-format --keep-extraneous-parens
and then blackened. pyupgrade comes from
https://github.com/asottile/pyupgrade with a patch to let me preserve
extraneous parens (which we use for marking strings that shouldn't be
translated), and lets us clean up a bunch of idioms that have cruftily
accumulated over the years.
# skip-blame no-op automated code cleanups
Differential Revision: https://phab.mercurial-scm.org/D8255
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 06 Mar 2020 13:27:41 -0500 |
parents | d543ef183eb8 |
children | 79ac59d3f73d |
comparison
equal
deleted
inserted
replaced
44449:ff72bd52d56a | 44452:9d2b2df2c2ba |
---|---|
933 ) | 933 ) |
934 | 934 |
935 normalizecrlf('doc/%s.html' % root) | 935 normalizecrlf('doc/%s.html' % root) |
936 | 936 |
937 # This logic is duplicated in doc/Makefile. | 937 # This logic is duplicated in doc/Makefile. |
938 sources = set( | 938 sources = { |
939 f | 939 f |
940 for f in os.listdir('mercurial/helptext') | 940 for f in os.listdir('mercurial/helptext') |
941 if re.search(r'[0-9]\.txt$', f) | 941 if re.search(r'[0-9]\.txt$', f) |
942 ) | 942 } |
943 | 943 |
944 # common.txt is a one-off. | 944 # common.txt is a one-off. |
945 gentxt('common') | 945 gentxt('common') |
946 | 946 |
947 for source in sorted(sources): | 947 for source in sorted(sources): |
977 | 977 |
978 def get_sub_commands(self): | 978 def get_sub_commands(self): |
979 # Screen out egg related commands to prevent egg generation. But allow | 979 # Screen out egg related commands to prevent egg generation. But allow |
980 # mercurial.egg-info generation, since that is part of modern | 980 # mercurial.egg-info generation, since that is part of modern |
981 # packaging. | 981 # packaging. |
982 excl = set(['bdist_egg']) | 982 excl = {'bdist_egg'} |
983 return filter(lambda x: x not in excl, install.get_sub_commands(self)) | 983 return filter(lambda x: x not in excl, install.get_sub_commands(self)) |
984 | 984 |
985 | 985 |
986 class hginstalllib(install_lib): | 986 class hginstalllib(install_lib): |
987 ''' | 987 ''' |