Mercurial > public > mercurial-scm > hg
annotate rust/hg-core/src/fncache.rs @ 52664:f5091286b10c
packaging: modernize (compat PEP 517) with less distutils and setup.py calls
- setup.py: less distutils imports and setuptools required
distutils is deprecated and one should import commands from setuptools to support
modern workflows depending on PEP 517 and 518.
Moreover, for Python >=3.12, distutils comes from setuptools. It corresponds to old and
unmaintain code that do not support PEP 517.
The PEP 517 frontends (pip, build, pipx, PDM, UV, etc.) are responsible for creating a
venv just for the build. The build dependencies (currently only setuptools) are specified
in the pyproject.toml file. Therefore, there is no reason to support building without
setuptools.
Calling directly setup.py is deprecated and we have to use a PEP 517 frontend.
For this commit we use pip with venv.
- run-tests.py: install with pip instead of direct call of setup.py
Mercurial is then built in an isolated environment.
- Makefile: use venv+pip instead of setup.py
author | paugier <pierre.augier@univ-grenoble-alpes.fr> |
---|---|
date | Wed, 08 Jan 2025 05:07:00 +0100 |
parents | 1a8466fd904a |
children |
rev | line source |
---|---|
52166 | 1 use std::path::Path; |
2 | |
3 use dyn_clone::DynClone; | |
4 | |
5 /// The FnCache stores the list of most files contained in the store and is | |
6 /// used for stream/copy clones. | |
7 /// | |
8 /// It keeps track of the name of "all" indexes and data files for all revlogs. | |
9 /// The names are relative to the store roots and are stored before any | |
10 /// encoding or path compression. | |
11 /// | |
12 /// Despite its name, the FnCache is *NOT* a cache, it keep tracks of | |
13 /// information that is not easily available elsewhere. It has no mechanism | |
14 /// for detecting isn't up to date, and de-synchronization with the actual | |
15 /// contents of the repository will lead to a corrupted clone and possibly | |
16 /// other corruption during maintenance operations. | |
17 /// Strictly speaking, it could be recomputed by looking at the contents of all | |
18 /// manifests AND actual store files on disk, however that is a | |
19 /// prohibitively expensive operation. | |
20 pub trait FnCache: Sync + Send + DynClone { | |
21 /// Whether the fncache was loaded from disk | |
22 fn is_loaded(&self) -> bool; | |
23 /// Add a path to be tracked in the fncache | |
24 fn add(&self, path: &Path); | |
25 // TODO add more methods once we start doing more with the FnCache | |
26 } |