comparison mercurial/commands.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 bd7b2c8d06cc
comparison
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
3719 for branch in repo.branchmap(): 3719 for branch in repo.branchmap():
3720 heads += repo.branchheads(branch, start, opts.get(b'closed')) 3720 heads += repo.branchheads(branch, start, opts.get(b'closed'))
3721 heads = [repo[h] for h in heads] 3721 heads = [repo[h] for h in heads]
3722 3722
3723 if branchrevs: 3723 if branchrevs:
3724 branches = set( 3724 branches = {
3725 repo[r].branch() for r in scmutil.revrange(repo, branchrevs) 3725 repo[r].branch() for r in scmutil.revrange(repo, branchrevs)
3726 ) 3726 }
3727 heads = [h for h in heads if h.branch() in branches] 3727 heads = [h for h in heads if h.branch() in branches]
3728 3728
3729 if opts.get(b'active') and branchrevs: 3729 if opts.get(b'active') and branchrevs:
3730 dagheads = repo.heads(start) 3730 dagheads = repo.heads(start)
3731 heads = [h for h in heads if h.node() in dagheads] 3731 heads = [h for h in heads if h.node() in dagheads]
3732 3732
3733 if branchrevs: 3733 if branchrevs:
3734 haveheads = set(h.branch() for h in heads) 3734 haveheads = {h.branch() for h in heads}
3735 if branches - haveheads: 3735 if branches - haveheads:
3736 headless = b', '.join(b for b in branches - haveheads) 3736 headless = b', '.join(b for b in branches - haveheads)
3737 msg = _(b'no open branch heads found on branches %s') 3737 msg = _(b'no open branch heads found on branches %s')
3738 if opts.get(b'rev'): 3738 if opts.get(b'rev'):
3739 msg += _(b' (started at %s)') % opts[b'rev'] 3739 msg += _(b' (started at %s)') % opts[b'rev']