mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
0b39ff42d9
Summary: Handling sections and normal config items. `%` support will be added in an upcoming patch. Note: regex would make the code simpler - the expression `^([^\s=]+)\s*=\s*(.*(?:\n[\t ].*)*)\s*` can extract both config name and multi-line values. However a naive benchmark shows it is 20x slower parsing larger files, and it has some initialization cost. Config parsing is at such a low level and its performance is critical. So the code does its own parsing instead of using regex. Reviewed By: mitrandir77 Differential Revision: D8779051 fbshipit-source-id: a2de698f0676c886737c47891a0400f187bff822 |
||
---|---|---|
.. | ||
argparse | ||
cdatapack | ||
clib | ||
commitcloudsubscriber | ||
configparser | ||
hg_watchman_client | ||
indexedlog | ||
linelog | ||
lz4-pyframe | ||
minibench | ||
mpatch | ||
mpatch-sys | ||
pathencoding | ||
pathmatcher | ||
radixbuf | ||
revisionstore | ||
third-party | ||
treestate | ||
vlqencoding | ||
watchman_client | ||
zstdelta | ||
Cargo.toml | ||
README.md |
lib
Any native code (C/C++/Rust) that Mercurial (either core or extensions)
depends on should go here. Python code, or native code that depends on
Python code (e.g. #include <Python.h>
or use cpython
) is disallowed.
As we start to convert more of Mercurial into Rust, and write new paths entrirely in native code, we'll want to limit our dependency on Python, which is why this barrier exists.
See also hgext/extlib/README.md
, mercurial/cext/README.mb
.
How do I choose between lib
and extlib
(and cext
)?
If your code is native and doesn't depend on Python (awesome!), it goes here.
Otherwise, put it in hgext/extlib
(if it's only used by extensions) or
mercurial/cext
(if it's used by extensions or core).