Show More
@@ -276,28 +276,7 b' pub fn run(invocation: &crate::CliInvoca' | |||
|
276 | 276 | let after_status = |res: StatusResult| -> Result<_, CommandError> { |
|
277 | 277 | let (mut ds_status, pattern_warnings) = res?; |
|
278 | 278 | for warning in pattern_warnings { |
|
279 | match warning { | |
|
280 | hg::PatternFileWarning::InvalidSyntax(path, syntax) => ui | |
|
281 | .write_stderr(&format_bytes!( | |
|
282 | b"{}: ignoring invalid syntax '{}'\n", | |
|
283 | get_bytes_from_path(path), | |
|
284 | &*syntax | |
|
285 | ))?, | |
|
286 | hg::PatternFileWarning::NoSuchFile(path) => { | |
|
287 | let path = if let Ok(relative) = | |
|
288 | path.strip_prefix(repo.working_directory_path()) | |
|
289 | { | |
|
290 | relative | |
|
291 | } else { | |
|
292 | &*path | |
|
293 | }; | |
|
294 | ui.write_stderr(&format_bytes!( | |
|
295 | b"skipping unreadable pattern file '{}': \ | |
|
296 | No such file or directory\n", | |
|
297 | get_bytes_from_path(path), | |
|
298 | ))? | |
|
299 | } | |
|
300 | } | |
|
279 | ui.write_stderr(&print_pattern_file_warning(&warning, &repo))?; | |
|
301 | 280 | } |
|
302 | 281 | |
|
303 | 282 | for (path, error) in ds_status.bad { |
@@ -582,3 +561,30 b' fn unsure_is_modified(' | |||
|
582 | 561 | }; |
|
583 | 562 | Ok(p1_contents != &*fs_contents) |
|
584 | 563 | } |
|
564 | ||
|
565 | fn print_pattern_file_warning( | |
|
566 | warning: &PatternFileWarning, | |
|
567 | repo: &Repo, | |
|
568 | ) -> Vec<u8> { | |
|
569 | match warning { | |
|
570 | PatternFileWarning::InvalidSyntax(path, syntax) => format_bytes!( | |
|
571 | b"{}: ignoring invalid syntax '{}'\n", | |
|
572 | get_bytes_from_path(path), | |
|
573 | &*syntax | |
|
574 | ), | |
|
575 | PatternFileWarning::NoSuchFile(path) => { | |
|
576 | let path = if let Ok(relative) = | |
|
577 | path.strip_prefix(repo.working_directory_path()) | |
|
578 | { | |
|
579 | relative | |
|
580 | } else { | |
|
581 | &*path | |
|
582 | }; | |
|
583 | format_bytes!( | |
|
584 | b"skipping unreadable pattern file '{}': \ | |
|
585 | No such file or directory\n", | |
|
586 | get_bytes_from_path(path), | |
|
587 | ) | |
|
588 | } | |
|
589 | } | |
|
590 | } |
General Comments 0
You need to be logged in to leave comments.
Login now