--- a/mercurial/repocache.py Sat Oct 05 10:29:34 2019 -0400
+++ b/mercurial/repocache.py Sun Oct 06 09:45:02 2019 -0400
@@ -19,6 +19,7 @@
util,
)
+
class repoloader(object):
"""Load repositories in background thread
@@ -68,8 +69,9 @@
loader thread.
"""
if self._thread and self._thread.is_alive():
- raise error.ProgrammingError(b'cannot obtain cached repo while '
- b'loader is active')
+ raise error.ProgrammingError(
+ b'cannot obtain cached repo while ' b'loader is active'
+ )
return self._cache.peek(path, None)
def _mainloop(self):
@@ -99,10 +101,15 @@
except KeyError:
repo = hg.repository(self._ui, path).unfiltered()
_warmupcache(repo)
- repo.ui.log(b'repocache', b'loaded repo into cache: %s (in %.3fs)\n',
- path, util.timer() - start)
+ repo.ui.log(
+ b'repocache',
+ b'loaded repo into cache: %s (in %.3fs)\n',
+ path,
+ util.timer() - start,
+ )
self._cache.insert(path, repo)
+
# TODO: think about proper API of preloading cache
def _warmupcache(repo):
repo.invalidateall()
@@ -115,6 +122,7 @@
obsolete.getrevs(repo, name)
repo._phasecache.loadphaserevs(repo)
+
# TODO: think about proper API of attaching preloaded attributes
def copycache(srcrepo, destrepo):
"""Copy cached attributes from srcrepo to destrepo"""