Mercurial > public > mercurial-scm > hg
comparison mercurial/copies.py @ 43785:3b039e43a1e6
copies: do not initialize the dictionary with root in changeset copies
We don't strictly need the dict to be prefiled with `{}`. Not doing so will make
the next changeset simpler. This part of a preparation to use native code for
this part of copy tracing.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 13 Nov 2019 09:39:44 +0100 |
parents | 995066c41bb2 |
children | 421ea5772039 |
comparison
equal
deleted
inserted
replaced
43784:995066c41bb2 | 43785:3b039e43a1e6 |
---|---|
279 | 279 |
280 iterrevs = set(from_head) | 280 iterrevs = set(from_head) |
281 iterrevs &= mrset | 281 iterrevs &= mrset |
282 iterrevs.update(roots) | 282 iterrevs.update(roots) |
283 iterrevs.remove(b.rev()) | 283 iterrevs.remove(b.rev()) |
284 all_copies = {r: {} for r in roots} | 284 all_copies = {} |
285 alwaysmatch = match.always() | 285 alwaysmatch = match.always() |
286 for r in sorted(iterrevs): | 286 for r in sorted(iterrevs): |
287 copies = all_copies.pop(r) | 287 copies = all_copies.pop(r, None) |
288 if copies is None: | |
289 # this is a root | |
290 copies = {} | |
288 for i, c in enumerate(children[r]): | 291 for i, c in enumerate(children[r]): |
289 p1, p2, p1copies, p2copies, removed = revinfo(c) | 292 p1, p2, p1copies, p2copies, removed = revinfo(c) |
290 if r == p1: | 293 if r == p1: |
291 parent = 1 | 294 parent = 1 |
292 childcopies = p1copies | 295 childcopies = p1copies |