comparison rust/hg-core/src/errors.rs @ 49174:3f86ee422095

censor: make rhg fall back to python when encountering a censored node This is to make it support censor.policy=ignore without having to duplicate that logic. Also, change the censor test in such a way that it uses rhg now, because extensions are disabled except when we call [hg censor]. Differential Revision: https://phab.mercurial-scm.org/D12607
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Thu, 05 May 2022 15:38:29 +0100
parents abeae090ce67
children 9f14126cfc4c
comparison
equal deleted inserted replaced
49173:90f7d8276e26 49174:3f86ee422095
40 /// These errors can happen in many places in the code because values are 40 /// These errors can happen in many places in the code because values are
41 /// parsed lazily as the file-level parser does not know the expected type 41 /// parsed lazily as the file-level parser does not know the expected type
42 /// and syntax of each value. 42 /// and syntax of each value.
43 #[from] 43 #[from]
44 ConfigValueParseError(ConfigValueParseError), 44 ConfigValueParseError(ConfigValueParseError),
45
46 /// Censored revision data.
47 CensoredNodeError,
45 } 48 }
46 49
47 /// Details about where an I/O error happened 50 /// Details about where an I/O error happened
48 #[derive(Debug)] 51 #[derive(Debug)]
49 pub enum IoErrorContext { 52 pub enum IoErrorContext {
99 write!(f, "abort: {}", explanation) 102 write!(f, "abort: {}", explanation)
100 } 103 }
101 HgError::UnsupportedFeature(explanation) => { 104 HgError::UnsupportedFeature(explanation) => {
102 write!(f, "unsupported feature: {}", explanation) 105 write!(f, "unsupported feature: {}", explanation)
103 } 106 }
107 HgError::CensoredNodeError => {
108 write!(f, "encountered a censored node")
109 }
104 HgError::ConfigValueParseError(error) => error.fmt(f), 110 HgError::ConfigValueParseError(error) => error.fmt(f),
105 } 111 }
106 } 112 }
107 } 113 }
108 114