Mercurial > hg
comparison rust/hg-core/src/requirements.rs @ 45937:2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Differential Revision: https://phab.mercurial-scm.org/D9399
author | Simon Sapin <simon-commits@exyr.org> |
---|---|
date | Tue, 24 Nov 2020 18:52:38 +0100 |
parents | a2eda1ff22aa |
children | f5d62f4d5327 |
comparison
equal
deleted
inserted
replaced
45936:0ce15a8c7b8b | 45937:2ad2745e0be9 |
---|---|
49 } | 49 } |
50 | 50 |
51 Err(error) => Err(RequirementsError::Io(error))?, | 51 Err(error) => Err(RequirementsError::Io(error))?, |
52 } | 52 } |
53 } | 53 } |
54 | |
55 pub fn check(repo_root: &Path) -> Result<(), RequirementsError> { | |
56 for feature in load(repo_root)? { | |
57 if !SUPPORTED.contains(&&*feature) { | |
58 return Err(RequirementsError::Unsupported { feature }) | |
59 } | |
60 } | |
61 Ok(()) | |
62 } | |
63 | |
64 // TODO: set this to actually-supported features | |
65 const SUPPORTED: &[&str] = &[ | |
66 "dotencode", | |
67 "fncache", | |
68 "generaldelta", | |
69 "revlogv1", | |
70 "sparserevlog", | |
71 "store", | |
72 ]; |