Mercurial > hg
comparison mercurial/interfaces/repository.py @ 47296:d1589957fdcb
updatecaches: introduce a set of constants to control which are updated
Passing around a set of constant to select what need warming will be cleaner
and more flexible. We did not changed the API yet, as this changes is already
large enough. In the rest of the rest we will change more code to actually use
this constants (or more realistically pre-defined set of constant directly)
Differential Revision: https://phab.mercurial-scm.org/D10727
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 17 May 2021 14:41:09 +0200 |
parents | 19d4802cb304 |
children | 7edaf91c7886 |
comparison
equal
deleted
inserted
replaced
47295:dd339191f2dc | 47296:d1589957fdcb |
---|---|
1 # repository.py - Interfaces and base classes for repositories and peers. | 1 # repository.py - Interfaces and base classes for repositories and peers. |
2 # coding: utf-8 | |
2 # | 3 # |
3 # Copyright 2017 Gregory Szorc <gregory.szorc@gmail.com> | 4 # Copyright 2017 Gregory Szorc <gregory.szorc@gmail.com> |
4 # | 5 # |
5 # This software may be used and distributed according to the terms of the | 6 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
40 | 41 |
41 CG_DELTAMODE_STD = b'default' | 42 CG_DELTAMODE_STD = b'default' |
42 CG_DELTAMODE_PREV = b'previous' | 43 CG_DELTAMODE_PREV = b'previous' |
43 CG_DELTAMODE_FULL = b'fulltext' | 44 CG_DELTAMODE_FULL = b'fulltext' |
44 CG_DELTAMODE_P1 = b'p1' | 45 CG_DELTAMODE_P1 = b'p1' |
46 | |
47 | |
48 ## Cache related constants: | |
49 # | |
50 # Used to control which cache should be warmed in a repo.updatecaches(…) call. | |
51 | |
52 # Warm branchmaps of all known repoview's filter-level | |
53 CACHE_BRANCHMAP_ALL = b"branchmap-all" | |
54 # Warm branchmaps of repoview's filter-level used by server | |
55 CACHE_BRANCHMAP_SERVED = b"branchmap-served" | |
56 # Warm internal changelog cache (eg: persistent nodemap) | |
57 CACHE_CHANGELOG_CACHE = b"changelog-cache" | |
58 # Warm full manifest cache | |
59 CACHE_FULL_MANIFEST = b"full-manifest" | |
60 # Warm file-node-tags cache | |
61 CACHE_FILE_NODE_TAGS = b"file-node-tags" | |
62 # Warm internal manifestlog cache (eg: persistent nodemap) | |
63 CACHE_MANIFESTLOG_CACHE = b"manifestlog-cache" | |
64 # Warn rev branch cache | |
65 CACHE_REV_BRANCH = b"rev-branch-cache" | |
66 # Warm tags' cache for default repoview' | |
67 CACHE_TAGS_DEFAULT = b"tags-default" | |
68 # Warm tags' cache for repoview's filter-level used by server | |
69 CACHE_TAGS_SERVED = b"tags-served" | |
70 | |
71 # the cache to warm by default after a simple transaction | |
72 # (this is a mutable set to let extension update it) | |
73 CACHES_DEFAULT = { | |
74 CACHE_BRANCHMAP_SERVED, | |
75 } | |
76 | |
77 # the caches to warm when warming all of them | |
78 # (this is a mutable set to let extension update it) | |
79 CACHES_ALL = { | |
80 CACHE_BRANCHMAP_SERVED, | |
81 CACHE_BRANCHMAP_ALL, | |
82 CACHE_CHANGELOG_CACHE, | |
83 CACHE_FILE_NODE_TAGS, | |
84 CACHE_FULL_MANIFEST, | |
85 CACHE_MANIFESTLOG_CACHE, | |
86 CACHE_TAGS_DEFAULT, | |
87 CACHE_TAGS_SERVED, | |
88 } | |
45 | 89 |
46 | 90 |
47 class ipeerconnection(interfaceutil.Interface): | 91 class ipeerconnection(interfaceutil.Interface): |
48 """Represents a "connection" to a repository. | 92 """Represents a "connection" to a repository. |
49 | 93 |