sapling/lib
Jun Wu 64c981f938 types: alias HgId to Id20
Summary:
The `HgId` implements a lot of convenient features. Alias it to Id20 so we can
use it for other 20-byte stuff, like a non-hg SHA1 binary hash.

In the future we might want to make `HgId` and `Id20` incompatible types.
For example, define `struct HgId(Id20)`, and define deref, and handy constructors.
But that requires larger code change.

The name `Id20` is Stefan Filip's idea.

Reviewed By: sfilipco

Differential Revision: D18265059

fbshipit-source-id: 4f505c1d38d25b405f7588d76a7752c32c62f8be
2019-11-01 10:38:32 -07:00
..
asyncrevisionstore/src types: rename Node to HgId 2019-10-18 18:13:31 -07:00
auth auth: add new crate to manage [auth] config section 2019-10-25 16:23:01 -07:00
backingstore backingstore: use ContentStore to import tree 2019-10-31 16:42:45 -07:00
blackbox clienttelemetry: log peer name to blackbox 2019-10-09 06:19:44 -07:00
bookmarkstore types: rename Node to HgId 2019-10-18 18:13:31 -07:00
cdatapack fix a warning about an ignored const keyword 2019-08-05 12:10:41 -07:00
clib types: rename Node to HgId 2019-10-18 18:13:31 -07:00
clidispatch dispatch: support Rust subcommands 2019-10-24 13:40:20 -07:00
cliparser dispatch: support Rust subcommands 2019-10-24 13:40:20 -07:00
commitcloudsubscriber commitcloudsubscriber: remove keychain and secrets tests 2019-10-30 11:17:26 -07:00
commitstore/bench-serialize commitstore/bench-serialize: add benchmark for mincode 2019-09-06 13:13:49 -07:00
configparser configparse: implement FromConfigValue for all primitive integer types 2019-10-28 11:13:05 -07:00
cpython-ext cpython-ext: fix PyByteArrayObject for python3 2019-10-28 15:44:20 -07:00
cpython-failure build: make it easier to switch between python2/3 2019-10-28 15:44:19 -07:00
dag tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
drawdag drawdag: implement a Rust drawdag library 2019-05-03 13:35:40 -07:00
edenapi edenapi: allow configuration via Rust ConfigSet 2019-10-28 11:13:05 -07:00
encoding Delete extern crate lines 2019-09-11 22:02:16 -07:00
hg_watchman_client Delete extern crate lines 2019-09-11 22:02:16 -07:00
hgcommands setup: move Python entrypoint to top-level 2019-10-29 19:02:22 -07:00
hgtime hgtime: parse a range 2019-10-08 11:11:02 -07:00
indexedlog tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
linelog linelog: update README 2018-11-08 12:34:36 -08:00
lz4-pyframe tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
manifest tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
mincode tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
minibench minibench: add a way to provide adhoc messages for measurement 2019-08-09 16:17:50 -07:00
mpatch Delete extern crate lines 2019-09-11 22:02:16 -07:00
mpatch-sys Delete extern crate lines 2019-09-11 22:02:16 -07:00
mutationstore tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
nodemap tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
pathmatcher pathmatcher: add Matcher trait 2019-07-22 13:03:00 -07:00
procinfo procinfo: upgrade winapi to 0.3 2019-07-16 17:10:59 -07:00
radixbuf tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
revisionstore revisionstore: make ContentStore to be able to accept suffix and add ContentStoreBuilder 2019-10-31 16:42:45 -07:00
stackdesc stackdesc: a thin library to annotate the current thread execution 2019-08-01 19:53:56 -07:00
third-party mincode: initial boilerplate 2019-09-06 13:13:47 -07:00
tracing-collector tracing-collector: merge repetitive calls in ASCII output 2019-10-29 20:29:09 -07:00
treestate tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
types types: alias HgId to Id20 2019-11-01 10:38:32 -07:00
util util: add expand_path function 2019-10-22 10:20:14 -07:00
vlqencoding tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
watchman_client Delete extern crate lines 2019-09-11 22:02:16 -07:00
workingcopy Workingcopy: Remove matcher reference 2019-09-25 11:00:05 -07:00
xdiff add symlink handling 2019-10-30 05:03:25 -07:00
xdiff-sys xdiff: add rust bindings (xdiff-sys) 2019-09-26 11:01:09 -07:00
zstdelta tp2/rust: update rust-crates-io 2019-10-31 09:40:40 -07:00
CMakeLists.txt backingstore: make backingstore buildable with CMake 2019-10-19 18:48:44 -07:00
README.md READMEs: tweaks based on feedback 2018-01-12 12:35:52 -08:00

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).