Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.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 | da5ccc591cff |
children | 843418dc0b1b |
comparison
equal
deleted
inserted
replaced
44449:ff72bd52d56a | 44452:9d2b2df2c2ba |
---|---|
785 def disabled(): | 785 def disabled(): |
786 '''find disabled extensions from hgext. returns a dict of {name: desc}''' | 786 '''find disabled extensions from hgext. returns a dict of {name: desc}''' |
787 try: | 787 try: |
788 from hgext import __index__ # pytype: disable=import-error | 788 from hgext import __index__ # pytype: disable=import-error |
789 | 789 |
790 return dict( | 790 return { |
791 (name, gettext(desc)) | 791 name: gettext(desc) |
792 for name, desc in pycompat.iteritems(__index__.docs) | 792 for name, desc in pycompat.iteritems(__index__.docs) |
793 if name not in _order | 793 if name not in _order |
794 ) | 794 } |
795 except (ImportError, AttributeError): | 795 except (ImportError, AttributeError): |
796 pass | 796 pass |
797 | 797 |
798 paths = _disabledpaths() | 798 paths = _disabledpaths() |
799 if not paths: | 799 if not paths: |