rust/hg-core/src/requirements.rs
changeset 46463 95b276283b67
parent 46462 d03b0601e0eb
child 46614 a069639783a0
equal deleted inserted replaced
46462:d03b0601e0eb 46463:95b276283b67
    18             } else {
    18             } else {
    19                 Err(HgError::corrupted("parse error in 'requires' file"))
    19                 Err(HgError::corrupted("parse error in 'requires' file"))
    20             }
    20             }
    21         })
    21         })
    22         .collect()
    22         .collect()
       
    23 }
       
    24 
       
    25 pub(crate) fn load(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> {
       
    26     parse(&hg_vfs.read("requires")?)
    23 }
    27 }
    24 
    28 
    25 pub(crate) fn load_if_exists(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> {
    29 pub(crate) fn load_if_exists(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> {
    26     if let Some(bytes) = hg_vfs.read("requires").io_not_found_as_none()? {
    30     if let Some(bytes) = hg_vfs.read("requires").io_not_found_as_none()? {
    27         parse(&bytes)
    31         parse(&bytes)
    56     "dotencode",
    60     "dotencode",
    57     "fncache",
    61     "fncache",
    58     "generaldelta",
    62     "generaldelta",
    59     "revlogv1",
    63     "revlogv1",
    60     SHARED_REQUIREMENT,
    64     SHARED_REQUIREMENT,
       
    65     SHARESAFE_REQUIREMENT,
    61     SPARSEREVLOG_REQUIREMENT,
    66     SPARSEREVLOG_REQUIREMENT,
    62     RELATIVE_SHARED_REQUIREMENT,
    67     RELATIVE_SHARED_REQUIREMENT,
    63     "store",
    68     "store",
    64     // As of this writing everything rhg does is read-only.
    69     // As of this writing everything rhg does is read-only.
    65     // When it starts writing to the repository, it’ll need to either keep the
    70     // When it starts writing to the repository, it’ll need to either keep the
   128 
   133 
   129 /// A repository with share implemented safely. The repository has different
   134 /// A repository with share implemented safely. The repository has different
   130 /// store and working copy requirements i.e. both `.hg/requires` and
   135 /// store and working copy requirements i.e. both `.hg/requires` and
   131 /// `.hg/store/requires` are present.
   136 /// `.hg/store/requires` are present.
   132 #[allow(unused)]
   137 #[allow(unused)]
   133 pub(crate) const SHARESAFE_REQUIREMENT: &str = "exp-sharesafe";
   138 pub(crate) const SHARESAFE_REQUIREMENT: &str = "share-safe";