Show More
@@ -57,7 +57,7 b' pub enum PatternSyntax {' | |||
|
57 | 57 | RelRegexp, |
|
58 | 58 | /// A path relative to repository root, which is matched non-recursively |
|
59 | 59 | /// (will not match subdirectories) |
|
60 | RootFiles, | |
|
60 | RootFilesIn, | |
|
61 | 61 | /// A file of patterns to read and include |
|
62 | 62 | Include, |
|
63 | 63 | /// A file of patterns to match against files under the same directory |
@@ -158,7 +158,7 b' pub fn parse_pattern_syntax(' | |||
|
158 | 158 | b"path:" => Ok(PatternSyntax::Path), |
|
159 | 159 | b"filepath:" => Ok(PatternSyntax::FilePath), |
|
160 | 160 | b"relpath:" => Ok(PatternSyntax::RelPath), |
|
161 | b"rootfilesin:" => Ok(PatternSyntax::RootFiles), | |
|
161 | b"rootfilesin:" => Ok(PatternSyntax::RootFilesIn), | |
|
162 | 162 | b"relglob:" => Ok(PatternSyntax::RelGlob), |
|
163 | 163 | b"relre:" => Ok(PatternSyntax::RelRegexp), |
|
164 | 164 | b"glob:" => Ok(PatternSyntax::Glob), |
@@ -227,7 +227,7 b' fn _build_single_regex(entry: &IgnorePat' | |||
|
227 | 227 | } |
|
228 | 228 | [escape_pattern(pattern).as_slice(), b"(?:/|$)"].concat() |
|
229 | 229 | } |
|
230 | PatternSyntax::RootFiles => { | |
|
230 | PatternSyntax::RootFilesIn => { | |
|
231 | 231 | let mut res = if pattern == b"." { |
|
232 | 232 | vec![] |
|
233 | 233 | } else { |
@@ -316,7 +316,7 b' pub fn build_single_regex(' | |||
|
316 | 316 | | PatternSyntax::Path |
|
317 | 317 | | PatternSyntax::RelGlob |
|
318 | 318 | | PatternSyntax::RelPath |
|
319 | | PatternSyntax::RootFiles => normalize_path_bytes(pattern), | |
|
319 | | PatternSyntax::RootFilesIn => normalize_path_bytes(pattern), | |
|
320 | 320 | PatternSyntax::Include | PatternSyntax::SubInclude => { |
|
321 | 321 | return Err(PatternError::NonRegexPattern(entry.clone())) |
|
322 | 322 | } |
@@ -342,7 +342,7 b' lazy_static! {' | |||
|
342 | 342 | m.insert(b"path:".as_ref(), PatternSyntax::Path); |
|
343 | 343 | m.insert(b"filepath:".as_ref(), PatternSyntax::FilePath); |
|
344 | 344 | m.insert(b"relpath:".as_ref(), PatternSyntax::RelPath); |
|
345 | m.insert(b"rootfilesin:".as_ref(), PatternSyntax::RootFiles); | |
|
345 | m.insert(b"rootfilesin:".as_ref(), PatternSyntax::RootFilesIn); | |
|
346 | 346 | m.insert(b"relglob:".as_ref(), PatternSyntax::RelGlob); |
|
347 | 347 | m.insert(b"relre:".as_ref(), PatternSyntax::RelRegexp); |
|
348 | 348 | m.insert(b"glob:".as_ref(), PatternSyntax::Glob); |
@@ -385,7 +385,7 b' pub fn parse_one_pattern(' | |||
|
385 | 385 | | PatternSyntax::Glob |
|
386 | 386 | | PatternSyntax::RelGlob |
|
387 | 387 | | PatternSyntax::RelPath |
|
388 | | PatternSyntax::RootFiles | |
|
388 | | PatternSyntax::RootFilesIn | |
|
389 | 389 | if normalize => |
|
390 | 390 | { |
|
391 | 391 | normalize_path_bytes(pattern_bytes) |
@@ -395,7 +395,7 b" impl<'a> Matcher for PatternMatcher<'a> " | |||
|
395 | 395 | /// assert_eq!(matcher.matches(HgPath::new(b"but not this")), false); |
|
396 | 396 | /// /// |
|
397 | 397 | /// let ignore_patterns = |
|
398 | /// vec![IgnorePattern::new(PatternSyntax::RootFiles, b"dir/subdir", Path::new(""))]; | |
|
398 | /// vec![IgnorePattern::new(PatternSyntax::RootFilesIn, b"dir/subdir", Path::new(""))]; | |
|
399 | 399 | /// let matcher = IncludeMatcher::new(ignore_patterns).unwrap(); |
|
400 | 400 | /// /// |
|
401 | 401 | /// assert!(!matcher.matches(HgPath::new(b"file"))); |
@@ -866,7 +866,7 b' fn roots_and_dirs(' | |||
|
866 | 866 | }); |
|
867 | 867 | roots.push(pat.to_owned()); |
|
868 | 868 | } |
|
869 | PatternSyntax::RootFiles => { | |
|
869 | PatternSyntax::RootFilesIn => { | |
|
870 | 870 | let pat = if pattern == b"." { |
|
871 | 871 | &[] as &[u8] |
|
872 | 872 | } else { |
@@ -963,7 +963,7 b" fn build_match<'a>(" | |||
|
963 | 963 | // with a regex. |
|
964 | 964 | if ignore_patterns |
|
965 | 965 | .iter() |
|
966 | .all(|k| k.syntax == PatternSyntax::RootFiles) | |
|
966 | .all(|k| k.syntax == PatternSyntax::RootFilesIn) | |
|
967 | 967 | { |
|
968 | 968 | let dirs: HashSet<_> = ignore_patterns |
|
969 | 969 | .iter() |
@@ -1324,7 +1324,7 b' mod tests {' | |||
|
1324 | 1324 | |
|
1325 | 1325 | // VisitdirRootfilesin |
|
1326 | 1326 | let m = PatternMatcher::new(vec![IgnorePattern::new( |
|
1327 | PatternSyntax::RootFiles, | |
|
1327 | PatternSyntax::RootFilesIn, | |
|
1328 | 1328 | b"dir/subdir", |
|
1329 | 1329 | Path::new(""), |
|
1330 | 1330 | )]) |
@@ -1353,7 +1353,7 b' mod tests {' | |||
|
1353 | 1353 | |
|
1354 | 1354 | // VisitchildrensetRootfilesin |
|
1355 | 1355 | let m = PatternMatcher::new(vec![IgnorePattern::new( |
|
1356 | PatternSyntax::RootFiles, | |
|
1356 | PatternSyntax::RootFilesIn, | |
|
1357 | 1357 | b"dir/subdir", |
|
1358 | 1358 | Path::new(""), |
|
1359 | 1359 | )]) |
@@ -1537,7 +1537,7 b' mod tests {' | |||
|
1537 | 1537 | |
|
1538 | 1538 | // VisitchildrensetRootfilesin |
|
1539 | 1539 | let matcher = IncludeMatcher::new(vec![IgnorePattern::new( |
|
1540 | PatternSyntax::RootFiles, | |
|
1540 | PatternSyntax::RootFilesIn, | |
|
1541 | 1541 | b"dir/subdir", |
|
1542 | 1542 | Path::new(""), |
|
1543 | 1543 | )]) |
@@ -1672,7 +1672,7 b' mod tests {' | |||
|
1672 | 1672 | )]) |
|
1673 | 1673 | .unwrap(); |
|
1674 | 1674 | let m2 = IncludeMatcher::new(vec![IgnorePattern::new( |
|
1675 | PatternSyntax::RootFiles, | |
|
1675 | PatternSyntax::RootFilesIn, | |
|
1676 | 1676 | b"dir", |
|
1677 | 1677 | Path::new(""), |
|
1678 | 1678 | )]) |
@@ -1833,7 +1833,7 b' mod tests {' | |||
|
1833 | 1833 | ); |
|
1834 | 1834 | let m2 = Box::new( |
|
1835 | 1835 | IncludeMatcher::new(vec![IgnorePattern::new( |
|
1836 | PatternSyntax::RootFiles, | |
|
1836 | PatternSyntax::RootFilesIn, | |
|
1837 | 1837 | b"dir", |
|
1838 | 1838 | Path::new(""), |
|
1839 | 1839 | )]) |
@@ -2084,7 +2084,7 b' mod tests {' | |||
|
2084 | 2084 | ); |
|
2085 | 2085 | let m2 = Box::new( |
|
2086 | 2086 | IncludeMatcher::new(vec![IgnorePattern::new( |
|
2087 | PatternSyntax::RootFiles, | |
|
2087 | PatternSyntax::RootFilesIn, | |
|
2088 | 2088 | b"dir", |
|
2089 | 2089 | Path::new("/repo"), |
|
2090 | 2090 | )]) |
@@ -2342,7 +2342,7 b' mod tests {' | |||
|
2342 | 2342 | ]; |
|
2343 | 2343 | let file_abcdfile = FileMatcher::new(files).unwrap(); |
|
2344 | 2344 | let _rootfilesin_dir = PatternMatcher::new(vec![IgnorePattern::new( |
|
2345 | PatternSyntax::RootFiles, | |
|
2345 | PatternSyntax::RootFilesIn, | |
|
2346 | 2346 | b"dir", |
|
2347 | 2347 | Path::new(""), |
|
2348 | 2348 | )]) |
General Comments 0
You need to be logged in to leave comments.
Login now