mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
3e73af0a9a
Summary: On Windows, some people use the "map drive" feature to map a long path (ex. `C:\long\path\to\repo`) to a short path (ex. `Z:\`) so their tooling can handle some long paths. In that case, resolving symlinks by `hg root` is undesirable. Unfortunately, the Rust stdlib does not have a Python `os.path.abspath` equivalent. There were some attempts (ex. https://github.com/rust-lang/rust/pull/47363) but the corner cases (ex. symlinks) have made the problem much more complicated. There are some 3rd-party crates. But they are not a good fit: - https://github.com/danreeves/path-clean/ (last commit fb84930) follows the golang plan9 idea. It does not have proper support for Windows paths. - https://github.com/vitiral/path_abs/ (latest commit 8370838) reinvents many path-related types, which is an overkill for this usecase. This diff implements the feature "reasonably" for both Windows and Linux, with nasty corner cases (symlink) ignored. Differential Revision: D16952485 fbshipit-source-id: ba91f4975c2e018362e2530119765a380f103e19 |
||
---|---|---|
.. | ||
asyncrevisionstore/src | ||
blackbox | ||
bookmarkstore | ||
cdatapack | ||
clib | ||
clidispatch | ||
cliparser | ||
commitcloudsubscriber | ||
configparser | ||
cpython-ext | ||
cpython-failure | ||
dag | ||
drawdag | ||
edenapi | ||
encoding | ||
hg_watchman_client | ||
hgcommands | ||
indexedlog | ||
linelog | ||
lz4-pyframe | ||
manifest | ||
minibench | ||
mpatch | ||
mpatch-sys | ||
mutationstore | ||
nodemap | ||
pathmatcher | ||
procinfo | ||
radixbuf | ||
revisionstore | ||
stackdesc | ||
third-party | ||
treestate | ||
types | ||
util | ||
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).