##// END OF EJS Templates
rhg: set the expected temp file permissions (0o666 minus umask)...
rhg: set the expected temp file permissions (0o666 minus umask) This continues the theme of a48c688d3e80, and fixes the bug #6375, which was causing some problems for us, where a non-group-readable file can't be copied, which breaks some tools that copy the repo. This affects both the `checkexec` file and the temporary file we use for filesystem time measurement, since either of these files remaining on disk can cause this problem, and the 0666 permissions are just the better default here.

File last commit:

r53251:ff19ddb2 default
r53422:66e34bc4 default
Show More
debugignorerhg.rs
58 lines | 1.7 KiB | application/rls-services+xml | RustLexer
use crate::error::CommandError;
use clap::Arg;
use hg::dirstate::status::StatusError;
use hg::filepatterns::RegexCompleteness;
use hg::matchers::get_ignore_matcher_pre;
use log::warn;
pub const HELP_TEXT: &str = "
Show effective hgignore patterns used by rhg.
This is a pure Rust version of `hg debugignore`.
Some options might be missing, check the list below.
";
pub fn args() -> clap::Command {
clap::command!("debugignorerhg")
.arg(
Arg::new("all-patterns")
.help("include all patterns, including ones for exact file matches")
.short('a')
.action(clap::ArgAction::SetTrue)
.long("all-patterns"),
).about(HELP_TEXT)
}
pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
let repo = invocation.repo?;
let args = invocation.subcommand_args;
let ignore_file = repo.working_directory_vfs().join(".hgignore"); // TODO hardcoded
let all_patterns = args.get_flag("all-patterns");
let (ignore_matcher, warnings) = get_ignore_matcher_pre(
vec![ignore_file],
repo.working_directory_path(),
&mut |_source, _pattern_bytes| (),
)
.map_err(StatusError::from)?;
let regex_config = if all_patterns {
RegexCompleteness::Complete
} else {
RegexCompleteness::ExcludeExactFiles
};
let ignore_matcher = ignore_matcher
.build_debug_matcher(regex_config)
.map_err(StatusError::from)?;
if !warnings.is_empty() {
warn!("Pattern warnings: {:?}", &warnings);
}
let patterns = ignore_matcher.debug_get_patterns();
invocation.ui.write_stdout(patterns)?;
invocation.ui.write_stdout(b"\n")?;
Ok(())
}