Mercurial > hg
comparison hgext/histedit.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 | 8cdd0b9629e3 |
children | ad5a10f49dfa |
comparison
equal
deleted
inserted
replaced
44449:ff72bd52d56a | 44452:9d2b2df2c2ba |
---|---|
833 if ctx.node() == parentctxnode: | 833 if ctx.node() == parentctxnode: |
834 repo.ui.warn(_(b'%s: empty changeset\n') % node.short(self.node)) | 834 repo.ui.warn(_(b'%s: empty changeset\n') % node.short(self.node)) |
835 return ctx, [(self.node, (parentctxnode,))] | 835 return ctx, [(self.node, (parentctxnode,))] |
836 | 836 |
837 parentctx = repo[parentctxnode] | 837 parentctx = repo[parentctxnode] |
838 newcommits = set( | 838 newcommits = { |
839 c.node() | 839 c.node() |
840 for c in repo.set(b'(%d::. - %d)', parentctx.rev(), parentctx.rev()) | 840 for c in repo.set(b'(%d::. - %d)', parentctx.rev(), parentctx.rev()) |
841 ) | 841 } |
842 if not newcommits: | 842 if not newcommits: |
843 repo.ui.warn( | 843 repo.ui.warn( |
844 _( | 844 _( |
845 b'%s: cannot fold - working copy is not a ' | 845 b'%s: cannot fold - working copy is not a ' |
846 b'descendant of previous commit %s\n' | 846 b'descendant of previous commit %s\n' |
2410 other constraints. | 2410 other constraints. |
2411 | 2411 |
2412 Will abort if there are to many or too few rules, a malformed rule, | 2412 Will abort if there are to many or too few rules, a malformed rule, |
2413 or a rule on a changeset outside of the user-given range. | 2413 or a rule on a changeset outside of the user-given range. |
2414 """ | 2414 """ |
2415 expected = set(c.node() for c in ctxs) | 2415 expected = {c.node() for c in ctxs} |
2416 seen = set() | 2416 seen = set() |
2417 prev = None | 2417 prev = None |
2418 | 2418 |
2419 if actions and actions[0].verb in [b'roll', b'fold']: | 2419 if actions and actions[0].verb in [b'roll', b'fold']: |
2420 raise error.ParseError( | 2420 raise error.ParseError( |