Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/requirements.rs @ 46525:95b276283b67
rhg: add support for share-safe
Differential Revision: https://phab.mercurial-scm.org/D9942
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 01 Feb 2021 11:41:10 +0100 |
parents | d03b0601e0eb |
children | a069639783a0 |
line wrap: on
line diff
--- a/rust/hg-core/src/requirements.rs Thu Jan 14 13:04:12 2021 +0100 +++ b/rust/hg-core/src/requirements.rs Mon Feb 01 11:41:10 2021 +0100 @@ -22,6 +22,10 @@ .collect() } +pub(crate) fn load(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { + parse(&hg_vfs.read("requires")?) +} + pub(crate) fn load_if_exists(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { if let Some(bytes) = hg_vfs.read("requires").io_not_found_as_none()? { parse(&bytes) @@ -58,6 +62,7 @@ "generaldelta", "revlogv1", SHARED_REQUIREMENT, + SHARESAFE_REQUIREMENT, SPARSEREVLOG_REQUIREMENT, RELATIVE_SHARED_REQUIREMENT, "store", @@ -130,4 +135,4 @@ /// store and working copy requirements i.e. both `.hg/requires` and /// `.hg/store/requires` are present. #[allow(unused)] -pub(crate) const SHARESAFE_REQUIREMENT: &str = "exp-sharesafe"; +pub(crate) const SHARESAFE_REQUIREMENT: &str = "share-safe";