# HG changeset patch # User Pierre-Yves David # Date 1621258938 -7200 # Node ID 7edaf91c7886fa8d7ebd71af021fdcb509beb04c # Parent e96f75857361ec1f8f0e367cd0b273fe7ba0ba40 updatecaches: use the `caches` argument instead of a special `full` value After a clone we want to update most cachem, but not exactly all of them. We can now cleanly express this. Differential Revision: https://phab.mercurial-scm.org/D10730 diff -r e96f75857361 -r 7edaf91c7886 mercurial/hg.py --- a/mercurial/hg.py Mon May 17 15:27:29 2021 +0200 +++ b/mercurial/hg.py Mon May 17 15:42:18 2021 +0200 @@ -52,6 +52,7 @@ verify as verifymod, vfs as vfsmod, ) +from .interfaces import repository as repositorymod from .utils import ( hashutil, stringutil, @@ -1054,7 +1055,7 @@ # as the only "bad" outcome would be some slowness. That potential # slowness already affect reader. with destrepo.lock(): - destrepo.updatecaches(full=b"post-clone") + destrepo.updatecaches(caches=repositorymod.CACHES_POST_CLONE) finally: release(srclock, destlock) if cleandir is not None: diff -r e96f75857361 -r 7edaf91c7886 mercurial/interfaces/repository.py --- a/mercurial/interfaces/repository.py Mon May 17 15:27:29 2021 +0200 +++ b/mercurial/interfaces/repository.py Mon May 17 15:42:18 2021 +0200 @@ -87,6 +87,11 @@ CACHE_TAGS_SERVED, } +# the cache to warm by default on simple call +# (this is a mutable set to let extension update it) +CACHES_POST_CLONE = CACHES_ALL.copy() +CACHES_POST_CLONE.discard(CACHE_FILE_NODE_TAGS) + class ipeerconnection(interfaceutil.Interface): """Represents a "connection" to a repository. diff -r e96f75857361 -r 7edaf91c7886 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon May 17 15:27:29 2021 +0200 +++ b/mercurial/localrepo.py Mon May 17 15:42:18 2021 +0200 @@ -2758,8 +2758,7 @@ if full: caches = repository.CACHES_ALL if full == b"post-clone": - caches = caches.copy() - caches.discard(repository.CACHE_FILE_NODE_TAGS) + caches = repository.CACHES_POST_CLONE else: caches = repository.CACHES_DEFAULT