Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 44470: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 | f82d2d4e71db |
children | 295417387769 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Fri Mar 06 10:52:44 2020 +0100 +++ b/mercurial/debugcommands.py Fri Mar 06 13:27:41 2020 -0500 @@ -584,7 +584,7 @@ dots = opts.get('dots') if file_: rlog = revlog.revlog(vfsmod.vfs(encoding.getcwd(), audit=False), file_) - revs = set((int(r) for r in revs)) + revs = {int(r) for r in revs} def events(): for r in rlog: @@ -1134,7 +1134,7 @@ (b'analyzed', filesetlang.analyze), (b'optimized', filesetlang.optimize), ] - stagenames = set(n for n, f in stages) + stagenames = {n for n, f in stages} showalways = set() if ui.verbose and not opts[b'show_stage']: @@ -2598,7 +2598,7 @@ dirstatefiles = set(dirstate) manifestonly = manifestfiles - dirstatefiles dsonly = dirstatefiles - manifestfiles - dsnotadded = set(f for f in dsonly if dirstate[f] != b'a') + dsnotadded = {f for f in dsonly if dirstate[f] != b'a'} changedfiles = manifestonly | dsnotadded dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles) @@ -3165,7 +3165,7 @@ raise error.Abort( _(b'cannot use --verify-optimized with --no-optimized') ) - stagenames = set(n for n, f in stages) + stagenames = {n for n, f in stages} showalways = set() showchanged = set()