##// END OF EJS Templates
interfaces: add a Protocol class for `scmutil.status`...
interfaces: add a Protocol class for `scmutil.status` I initially tried moving this to the `interfaces` package, both to have more cleanly defined interfaces (interfaces shouldn't have to reach into implementation files for their type info), and because importing `mercurial.ui` either directly or indirectly into `interfaces.repository` causes a situation where pytype stops inferring the type for `revlogutils.constants` that are imported by `revlog`. (Likely this is caused by a cycle. The `dirstate` interface already imports `scmutil`, which in turn imports `ui`, so the `repository` interface module importing the `dirstate` interface module as part of converting those classes to Protocol classes will trigger the issue.) I gave up on moving the class because `scmutil.status` depends on `stringutil`, which has a surprisingly long tail of dependencies. In any event, a standalone Protocol class might help with the Rust code.

File last commit:

r52858:145f66ea default
r53347:a1c0f19e default
Show More
cacheutil.py
25 lines | 931 B | text/x-python | PythonLexer
# scmutil.py - Mercurial core utility functions
#
# Copyright Olivia Mackall <olivia@selenic.com> and other
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import annotations
from . import repoview
def cachetocopy(srcrepo):
"""return the list of cache file valuable to copy during a clone"""
# In local clones we're copying all nodes, not just served
# ones. Therefore copy all branch caches over.
cachefiles = [b'branch2']
cachefiles += [b'branch2-%s' % f for f in repoview.filtertable]
cachefiles += [b'branch3-exp']
cachefiles += [b'branch3-exp-%s' % f for f in repoview.filtertable]
cachefiles += [b'rbc-names-v2', b'rbc-revs-v2']
cachefiles += [b'tags2']
cachefiles += [b'tags2-%s' % f for f in repoview.filtertable]
cachefiles += [b'hgtagsfnodes1']
return cachefiles