Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/filepatterns.rs (9 lines) | |||
M | rust/hg-core/src/utils.rs (9 lines) | |||
M | rust/hg-core/src/utils/files.rs (11 lines) |
// filepatterns.rs | |||||
// | |||||
// Copyright 2019 Raphaël Gomès <rgomes@octobus.net> | |||||
// | |||||
// This software may be used and distributed according to the terms of the | |||||
// GNU General Public License version 2 or any later version. | |||||
//! Handling of Mercurial-specific patterns. | |||||
use crate::{ | use crate::{ | ||||
utils::{files::get_path_from_bytes, SliceExt}, | utils::{files::get_path_from_bytes, SliceExt}, | ||||
LineNumber, PatternError, PatternFileError, | LineNumber, PatternError, PatternFileError, | ||||
}; | }; | ||||
use lazy_static::lazy_static; | use lazy_static::lazy_static; | ||||
use regex::bytes::{NoExpand, Regex}; | use regex::bytes::{NoExpand, Regex}; | ||||
use std::collections::HashMap; | use std::collections::HashMap; | ||||
use std::fs::File; | use std::fs::File; |
// utils module | |||||
// | |||||
// Copyright 2019 Raphaël Gomès <rgomes@octobus.net> | |||||
// | |||||
// This software may be used and distributed according to the terms of the | |||||
// GNU General Public License version 2 or any later version. | |||||
//! Contains useful functions, traits, structs, etc. for use in core. | |||||
pub mod files; | pub mod files; | ||||
use std::convert::AsMut; | use std::convert::AsMut; | ||||
/// Takes a slice and copies it into an array. | /// Takes a slice and copies it into an array. | ||||
/// | /// | ||||
/// # Panics | /// # Panics | ||||
/// | /// |
// files.rs | |||||
// | |||||
// Copyright 2019 | |||||
// Raphaël Gomès <rgomes@octobus.net>, | |||||
// Yuya Nishihara <yuya@tcha.org> | |||||
// | |||||
// This software may be used and distributed according to the terms of the | |||||
// GNU General Public License version 2 or any later version. | |||||
//! Functions for fiddling with files. | |||||
use std::iter::FusedIterator; | use std::iter::FusedIterator; | ||||
use std::path::Path; | use std::path::Path; | ||||
pub fn get_path_from_bytes(bytes: &[u8]) -> &Path { | pub fn get_path_from_bytes(bytes: &[u8]) -> &Path { | ||||
let os_str; | let os_str; | ||||
#[cfg(unix)] | #[cfg(unix)] | ||||
{ | { | ||||
use std::os::unix::ffi::OsStrExt; | use std::os::unix::ffi::OsStrExt; |