sapling/eden
Jun Wu f00af51977 types: add an abstract hash type
Summary:
There are a lot of hash types: HgId, Sha256, and edenapi-types has some.
The HgId seems to have most features but it is hard to reuse it for similar
but different types. This is an attempt to do so and unify the main implementation
of those types.

Most methods are copied from HgId. `from_byte_array` is made const fn so it
can be used to construct constants.

The error type is intentionally chosen to be not `anyhow::Error`.
Using static typed errors is considered good practice for low-level crates.
The benefit is that higher level users get their choice - precise static error
type with compile-time checks, or convenient, dynamic error types by anyhow
with runtime downcasts.

Reviewed By: yancouto

Differential Revision: D31615719

fbshipit-source-id: 337356721354c43fe23b9f2d0e90d104c8864c44
2021-10-13 13:27:31 -07:00
..
fs Separate constructor for passing spawner 2021-10-12 18:35:11 -07:00
hg-server mononoke: remove edenapi_server 2021-10-13 09:45:20 -07:00
integration suppress errors in fbcode/eden - batch 1 2021-10-12 13:08:00 -07:00
locale
mononoke test-edenapi-server-ephemeral-prepare: switch to debugapi 2021-10-13 13:27:30 -07:00
scm types: add an abstract hash type 2021-10-13 13:27:31 -07:00
test_support test_support: canonicalize the temporary directory path 2021-08-16 16:08:45 -07:00
test-data fix fsck snapshot integration tests 2021-07-14 16:20:04 -07:00
.gitignore
Eden.project.toml