comparison hgext/mq.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 4152183acedd
children 3b7aabd02e11
comparison
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
1160 else: 1160 else:
1161 unknown.append(p) 1161 unknown.append(p)
1162 1162
1163 if unknown: 1163 if unknown:
1164 if numrevs: 1164 if numrevs:
1165 rev = dict((entry.name, entry.node) for entry in qfinished) 1165 rev = {entry.name: entry.node for entry in qfinished}
1166 for p in unknown: 1166 for p in unknown:
1167 msg = _(b'revision %s refers to unknown patches: %s\n') 1167 msg = _(b'revision %s refers to unknown patches: %s\n')
1168 self.ui.warn(msg % (short(rev[p]), p)) 1168 self.ui.warn(msg % (short(rev[p]), p))
1169 else: 1169 else:
1170 msg = _(b'unknown patches: %s\n') 1170 msg = _(b'unknown patches: %s\n')
3359 if i != len(guards) - 1: 3359 if i != len(guards) - 1:
3360 ui.write(b' ') 3360 ui.write(b' ')
3361 ui.write(b'\n') 3361 ui.write(b'\n')
3362 3362
3363 q = repo.mq 3363 q = repo.mq
3364 applied = set(p.name for p in q.applied) 3364 applied = {p.name for p in q.applied}
3365 patch = None 3365 patch = None
3366 args = list(args) 3366 args = list(args)
3367 if opts.get('list'): 3367 if opts.get('list'):
3368 if args or opts.get('none'): 3368 if args or opts.get('none'):
3369 raise error.Abort( 3369 raise error.Abort(