Mercurial > hg
comparison hgext/strip.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 | 8ff1ecfadcd1 |
children | b7808443ed6a |
comparison
equal
deleted
inserted
replaced
44449:ff72bd52d56a | 44452:9d2b2df2c2ba |
---|---|
226 update = any( | 226 update = any( |
227 p != nullid and cl.rev(p) in strippedrevs | 227 p != nullid and cl.rev(p) in strippedrevs |
228 for p in repo.dirstate.parents() | 228 for p in repo.dirstate.parents() |
229 ) | 229 ) |
230 | 230 |
231 rootnodes = set(cl.node(r) for r in roots) | 231 rootnodes = {cl.node(r) for r in roots} |
232 | 232 |
233 q = getattr(repo, 'mq', None) | 233 q = getattr(repo, 'mq', None) |
234 if q is not None and q.applied: | 234 if q is not None and q.applied: |
235 # refresh queue state if we're about to strip | 235 # refresh queue state if we're about to strip |
236 # applied patches | 236 # applied patches |