Mercurial > public > mercurial-scm > hg
diff mercurial/copies.py @ 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 | f4733654f144 |
children | f19a3f1437f3 |
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: