When storing copy information in the changesets, this patch speeds up
hg debugpathcopies FENNEC_58_0_2_BUILD1 FIREFOX_59_0b8_BUILD2
from 11s to 5.9s. That command takes 6.2s when storing copy
information in filelogs.
hg-reviewers |
When storing copy information in the changesets, this patch speeds up
hg debugpathcopies FENNEC_58_0_2_BUILD1 FIREFOX_59_0b8_BUILD2
from 11s to 5.9s. That command takes 6.2s when storing copy
information in filelogs.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/copies.py (10 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
f72f2c0c071a | 68a0d73398eb | Martin von Zweigbergk | Apr 19 2019, 12:21 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
copies[dst] = copies1[dst] | copies[dst] = copies1[dst] | ||||
else: | else: | ||||
copies[dst] = copies2[dst] | copies[dst] = copies2[dst] | ||||
else: | else: | ||||
copies = copies1 | copies = copies1 | ||||
if r == b.rev(): | if r == b.rev(): | ||||
_filter(a, b, copies) | _filter(a, b, copies) | ||||
return copies | return copies | ||||
for c in children[r]: | for i, c in enumerate(children[r]): | ||||
childctx = repo[c] | childctx = repo[c] | ||||
if r == childctx.p1().rev(): | if r == childctx.p1().rev(): | ||||
parent = 1 | parent = 1 | ||||
childcopies = childctx.p1copies() | childcopies = childctx.p1copies() | ||||
else: | else: | ||||
assert r == childctx.p2().rev() | assert r == childctx.p2().rev() | ||||
parent = 2 | parent = 2 | ||||
childcopies = childctx.p2copies() | childcopies = childctx.p2copies() | ||||
if not match.always(): | if not match.always(): | ||||
childcopies = {dst: src for dst, src in childcopies.items() | childcopies = {dst: src for dst, src in childcopies.items() | ||||
if match(dst)} | if match(dst)} | ||||
# Copy the dict only if later iterations will also need it | |||||
if i != len(children[r]) - 1: | |||||
copies = copies.copy() | |||||
if childcopies: | |||||
childcopies = _chain(copies, childcopies) | childcopies = _chain(copies, childcopies) | ||||
else: | |||||
childcopies = copies | |||||
for f in childctx.filesremoved(): | for f in childctx.filesremoved(): | ||||
if f in childcopies: | if f in childcopies: | ||||
del childcopies[f] | del childcopies[f] | ||||
heapq.heappush(work, (c, parent, childcopies)) | heapq.heappush(work, (c, parent, childcopies)) | ||||
assert False | assert False | ||||
def _forwardcopies(a, b, match=None): | def _forwardcopies(a, b, match=None): | ||||
"""find {dst@b: src@a} copy mapping where a is an ancestor of b""" | """find {dst@b: src@a} copy mapping where a is an ancestor of b""" |