Skip to content
Snippets Groups Projects
Commit 421ea577 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

copies: split the combination of the copies mapping in its own function

In some case, this part take up to 95% of the copy tracing that take about a
hundred second. This poor performance comes from the fact we keep duplciating
and merging dictionary that are mostly similar.

I want to experiment with smarter native code to do this, so I need to isolate
the function first.
parent 3b039e43
No related branches found
No related tags found
No related merge requests found
......@@ -281,5 +281,20 @@
iterrevs &= mrset
iterrevs.update(roots)
iterrevs.remove(b.rev())
revs = sorted(iterrevs)
return _combinechangesetcopies(revs, children, b.rev(), revinfo, match)
def _combinechangesetcopies(revs, children, targetrev, revinfo, match):
"""combine the copies information for each item of iterrevs
revs: sorted iterable of revision to visit
children: a {parent: [children]} mapping.
targetrev: the final copies destination revision (not in iterrevs)
revinfo(rev): a function that return (p1, p2, p1copies, p2copies, removed)
match: a matcher
It returns the aggregated copies information for `targetrev`.
"""
all_copies = {}
alwaysmatch = match.always()
......@@ -284,6 +299,6 @@
all_copies = {}
alwaysmatch = match.always()
for r in sorted(iterrevs):
for r in revs:
copies = all_copies.pop(r, None)
if copies is None:
# this is a root
......@@ -336,7 +351,7 @@
else:
newcopies.update(othercopies)
all_copies[c] = newcopies
return all_copies[b.rev()]
return all_copies[targetrev]
def _forwardcopies(a, b, base=None, match=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment