Mercurial > public > mercurial-scm > hg
changeset 52649:d903647abbd3
pyupgrade: replace `dict(...)` with dict comprehensions
This was rewritten by the `dict_literals` fixer in `pyupgrade`. The last pass
over the code for this that I could find was a61ed1c2d7a7.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 06 Jan 2025 01:20:01 -0500 |
parents | abc327f9628b |
children | b95b12cb31e2 |
files | mercurial/copies.py mercurial/debugcommands.py |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/copies.py Mon Jan 06 01:12:54 2025 -0500 +++ b/mercurial/copies.py Mon Jan 06 01:20:01 2025 -0500 @@ -307,7 +307,7 @@ # revision that will be relevant for a edge of the graph. So if a # children has parent not in `children_count`, that edges should not be # processed. - children_count = dict((r, 0) for r in roots) + children_count = {r: 0 for r in roots} for r in revs: for p in cl.parentrevs(r): if p == nullrev: @@ -329,7 +329,7 @@ else: # When not using side-data, we will process the edges "from" the parent. # so we need a full mapping of the parent -> children relation. - children = dict((r, []) for r in roots) + children = {r: [] for r in roots} for r in revs: for p in cl.parentrevs(r): if p == nullrev:
--- a/mercurial/debugcommands.py Mon Jan 06 01:12:54 2025 -0500 +++ b/mercurial/debugcommands.py Mon Jan 06 01:20:01 2025 -0500 @@ -913,7 +913,7 @@ label = b' '.join(e[0] for e in entry) format = b' '.join(e[1] for e in entry) values = [e[3] for e in entry] - data = dict((e[2], e[3]) for e in entry) + data = {e[2]: e[3] for e in entry} fm.startitem() fm.write(label, format, *values, **data) fm.plain(b'\n')