##// END OF EJS Templates
rhg: Properly format warnings related to ignore patterns...
Simon Sapin -
r49342:c9abfb80 default
parent child Browse files
Show More
@@ -22,10 +22,11 b' use hg::manifest::Manifest;'
22 use hg::matchers::AlwaysMatcher;
22 use hg::matchers::AlwaysMatcher;
23 use hg::repo::Repo;
23 use hg::repo::Repo;
24 use hg::utils::files::get_bytes_from_os_string;
24 use hg::utils::files::get_bytes_from_os_string;
25 use hg::utils::files::get_bytes_from_path;
25 use hg::utils::files::get_path_from_bytes;
26 use hg::utils::files::get_path_from_bytes;
26 use hg::utils::hg_path::{hg_path_to_path_buf, HgPath};
27 use hg::utils::hg_path::{hg_path_to_path_buf, HgPath};
27 use hg::StatusOptions;
28 use hg::StatusOptions;
28 use log::{info, warn};
29 use log::info;
29 use std::io;
30 use std::io;
30 use std::path::PathBuf;
31 use std::path::PathBuf;
31
32
@@ -233,8 +234,29 b' pub fn run(invocation: &crate::CliInvoca'
233 ignore_files(repo, config),
234 ignore_files(repo, config),
234 options,
235 options,
235 )?;
236 )?;
236 if !pattern_warnings.is_empty() {
237 for warning in pattern_warnings {
237 warn!("Pattern warnings: {:?}", &pattern_warnings);
238 match warning {
239 hg::PatternFileWarning::InvalidSyntax(path, syntax) => ui
240 .write_stderr(&format_bytes!(
241 b"{}: ignoring invalid syntax '{}'\n",
242 get_bytes_from_path(path),
243 &*syntax
244 ))?,
245 hg::PatternFileWarning::NoSuchFile(path) => {
246 let path = if let Ok(relative) =
247 path.strip_prefix(repo.working_directory_path())
248 {
249 relative
250 } else {
251 &*path
252 };
253 ui.write_stderr(&format_bytes!(
254 b"skipping unreadable pattern file '{}': \
255 No such file or directory\n",
256 get_bytes_from_path(path),
257 ))?
258 }
259 }
238 }
260 }
239
261
240 for (path, error) in ds_status.bad {
262 for (path, error) in ds_status.bad {
General Comments 0
You need to be logged in to leave comments. Login now