comparison rust/rhg/src/ui.rs @ 48770:f19be290756a

rhg: signal when falling back in logs We use the `trace` level for the actual message because it can get really busy. Differential Revision: https://phab.mercurial-scm.org/D11814
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 26 Nov 2021 15:38:04 +0100
parents 3e2b4bb286e7
children 6939d5ed20e0
comparison
equal deleted inserted replaced
48769:1bb62821f080 48770:f19be290756a
217 // TODO encode for the user's system // 217 // TODO encode for the user's system //
218 let bytes = s.as_bytes(); 218 let bytes = s.as_bytes();
219 Cow::Borrowed(bytes) 219 Cow::Borrowed(bytes)
220 } 220 }
221 221
222 /// Decode user system bytes to Rust string.
223 pub fn local_to_utf8(s: &[u8]) -> Cow<str> {
224 // TODO decode from the user's system
225 String::from_utf8_lossy(s)
226 }
227
222 /// Should formatted output be used? 228 /// Should formatted output be used?
223 /// 229 ///
224 /// Note: rhg does not have the formatter mechanism yet, 230 /// Note: rhg does not have the formatter mechanism yet,
225 /// but this is also used when deciding whether to use color. 231 /// but this is also used when deciding whether to use color.
226 pub fn formatted(config: &Config) -> Result<bool, HgError> { 232 pub fn formatted(config: &Config) -> Result<bool, HgError> {