comparison mercurial/cmdutil.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 02bf61bb4a70
comparison
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
3123 subrepoutil.writestate(repo, newsubstate) 3123 subrepoutil.writestate(repo, newsubstate)
3124 3124
3125 ms = mergemod.mergestate.read(repo) 3125 ms = mergemod.mergestate.read(repo)
3126 mergeutil.checkunresolved(ms) 3126 mergeutil.checkunresolved(ms)
3127 3127
3128 filestoamend = set(f for f in wctx.files() if matcher(f)) 3128 filestoamend = {f for f in wctx.files() if matcher(f)}
3129 3129
3130 changes = len(filestoamend) > 0 3130 changes = len(filestoamend) > 0
3131 if changes: 3131 if changes:
3132 # Recompute copies (avoid recording a -> b -> a) 3132 # Recompute copies (avoid recording a -> b -> a)
3133 copied = copies.pathcopies(base, wctx, matcher) 3133 copied = copies.pathcopies(base, wctx, matcher)
3915 if tobackup is None: 3915 if tobackup is None:
3916 tobackup = set() 3916 tobackup = set()
3917 # Apply changes 3917 # Apply changes
3918 fp = stringio() 3918 fp = stringio()
3919 # chunks are serialized per file, but files aren't sorted 3919 # chunks are serialized per file, but files aren't sorted
3920 for f in sorted(set(c.header.filename() for c in chunks if ishunk(c))): 3920 for f in sorted({c.header.filename() for c in chunks if ishunk(c)}):
3921 prntstatusmsg(b'revert', f) 3921 prntstatusmsg(b'revert', f)
3922 files = set() 3922 files = set()
3923 for c in chunks: 3923 for c in chunks:
3924 if ishunk(c): 3924 if ishunk(c):
3925 abs = c.header.filename() 3925 abs = c.header.filename()