I was seeing weird stalls in some fast commands, and these trace
events help explain them.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I was seeing weird stalls in some fast commands, and these trace
events help explain them.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/obsolete.py (11 lines) | |||
M | mercurial/repoview.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
6d0932b9ac03 | 0574699e0456 | Augie Fackler | Jun 19 2019, 6:22 PM |
return func | return func | ||||
return decorator | return decorator | ||||
def getrevs(repo, name): | def getrevs(repo, name): | ||||
"""Return the set of revision that belong to the <name> set | """Return the set of revision that belong to the <name> set | ||||
Such access may compute the set and cache it for future use""" | Such access may compute the set and cache it for future use""" | ||||
repo = repo.unfiltered() | repo = repo.unfiltered() | ||||
with util.timedcm('getrevs %s', name): | |||||
if not repo.obsstore: | if not repo.obsstore: | ||||
return frozenset() | return frozenset() | ||||
if name not in repo.obsstore.caches: | if name not in repo.obsstore.caches: | ||||
repo.obsstore.caches[name] = cachefuncs[name](repo) | repo.obsstore.caches[name] = cachefuncs[name](repo) | ||||
return repo.obsstore.caches[name] | return repo.obsstore.caches[name] | ||||
# To be simple we need to invalidate obsolescence cache when: | # To be simple we need to invalidate obsolescence cache when: | ||||
# | # | ||||
# - new changeset is added: | # - new changeset is added: | ||||
# - public phase is changed | # - public phase is changed | ||||
# - obsolescence marker are added | # - obsolescence marker are added | ||||
# - strip is used a repo | # - strip is used a repo | ||||
def clearobscaches(repo): | def clearobscaches(repo): |
this changelog must not be used for writing""" | this changelog must not be used for writing""" | ||||
# some cache may be implemented later | # some cache may be implemented later | ||||
unfi = self._unfilteredrepo | unfi = self._unfilteredrepo | ||||
unfichangelog = unfi.changelog | unfichangelog = unfi.changelog | ||||
# bypass call to changelog.method | # bypass call to changelog.method | ||||
unfiindex = unfichangelog.index | unfiindex = unfichangelog.index | ||||
unfilen = len(unfiindex) | unfilen = len(unfiindex) | ||||
unfinode = unfiindex[unfilen - 1][7] | unfinode = unfiindex[unfilen - 1][7] | ||||
with util.timedcm('repo filter for %s', self.filtername): | |||||
revs = filterrevs(unfi, self.filtername, self._visibilityexceptions) | revs = filterrevs( | ||||
unfi, self.filtername, self._visibilityexceptions) | |||||
cl = self._clcache | cl = self._clcache | ||||
newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) | newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) | ||||
# if cl.index is not unfiindex, unfi.changelog would be | # if cl.index is not unfiindex, unfi.changelog would be | ||||
# recreated, and our clcache refers to garbage object | # recreated, and our clcache refers to garbage object | ||||
if (cl is not None and | if (cl is not None and | ||||
(cl.index is not unfiindex or newkey != self._clcachekey)): | (cl.index is not unfiindex or newkey != self._clcachekey)): | ||||
cl = None | cl = None | ||||
# could have been made None by the previous if | # could have been made None by the previous if |