##// END OF EJS Templates
convert: change socket mode from b'r+' to 'rwb' in cvs.py (issue6789)...
convert: change socket mode from b'r+' to 'rwb' in cvs.py (issue6789) 'r+' mode used to open sockets for read/write operations, but '+' is not supported in Python 3. We're using bytes with these sockets everywhere, so the mode should have 'b'. But the mode argument has to be str, not bytes.

File last commit:

r50534:37bc3ede default
r50798:8f9fbc66 stable
Show More
debugignorerhg.rs
40 lines | 1.1 KiB | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugignorerhg.rs
Arseniy Alekseyev
rhg: implement the debugignorerhg subcommand...
r49178 use crate::error::CommandError;
use clap::SubCommand;
use hg;
use hg::matchers::get_ignore_matcher;
use hg::StatusError;
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::App<'static, 'static> {
SubCommand::with_name("debugignorerhg").about(HELP_TEXT)
}
pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
let repo = invocation.repo?;
let ignore_file = repo.working_directory_vfs().join(".hgignore"); // TODO hardcoded
let (ignore_matcher, warnings) = get_ignore_matcher(
vec![ignore_file],
&repo.working_directory_path().to_owned(),
Raphaël Gomès
dirstate-v2: hash the source of the ignore patterns as well...
r50453 &mut |_source, _pattern_bytes| (),
Arseniy Alekseyev
rhg: implement the debugignorerhg subcommand...
r49178 )
.map_err(|e| StatusError::from(e))?;
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(())
}