From 10b71847daebdb3af21262c5ffa39c9222814534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sun, 16 Jan 2022 16:13:05 +1300 Subject: [PATCH] Add support for Pijul and Subversion --- cli/src/filterer/globset.rs | 5 +++++ cli/src/filterer/tagged.rs | 3 +++ lib/src/ignore/files.rs | 10 +++++++++- lib/src/project.rs | 10 +++++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cli/src/filterer/globset.rs b/cli/src/filterer/globset.rs index 6373927..cbd9cb3 100644 --- a/cli/src/filterer/globset.rs +++ b/cli/src/filterer/globset.rs @@ -41,6 +41,11 @@ pub async fn globset(args: &ArgMatches<'static>) -> Result) -> Result> { filters.push(Filter::from_glob_ignore(None, "/.hg")); } + if vcs_types.contains(&ProjectType::Subversion) { + filters.push(Filter::from_glob_ignore(None, "/.svn")); + } if vcs_types.contains(&ProjectType::Bazaar) { filters.push(Filter::from_glob_ignore(None, "/.bzr")); diff --git a/lib/src/ignore/files.rs b/lib/src/ignore/files.rs index 2cb7637..0c01323 100644 --- a/lib/src/ignore/files.rs +++ b/lib/src/ignore/files.rs @@ -347,7 +347,15 @@ impl DirTourist { filter .add_globs( - &["/.git", "/.hg", "/.bzr", "/_darcs", "/.fossil-settings"], + &[ + "/.git", + "/.hg", + "/.bzr", + "/_darcs", + "/.fossil-settings", + "/.svn", + "/.pijul", + ], Some(base.clone()), ) .await diff --git a/lib/src/project.rs b/lib/src/project.rs index c6e4836..4272ae3 100644 --- a/lib/src/project.rs +++ b/lib/src/project.rs @@ -38,6 +38,9 @@ pub enum ProjectType { /// VCS: [Pijul](https://pijul.org/). Pijul, + /// VCS: [Subversion](https://subversion.apache.org) (aka SVN). + Subversion, + /// Soft: [Ruby](https://www.ruby-lang.org/)’s [Bundler](https://bundler.io/). Bundler, @@ -85,7 +88,10 @@ impl ProjectType { pub fn is_vcs(self) -> bool { matches!( self, - Self::Bazaar | Self::Darcs | Self::Fossil | Self::Git | Self::Mercurial | Self::Pijul + Self::Bazaar + | Self::Darcs | Self::Fossil + | Self::Git | Self::Mercurial + | Self::Pijul | Self::Subversion ) } @@ -126,6 +132,7 @@ pub async fn origins(path: impl AsRef) -> HashSet { list.has_dir(".git"), list.has_dir(".github"), list.has_dir(".hg"), + list.has_dir(".svn"), list.has_file(".asf.yaml"), list.has_file(".bzrignore"), list.has_file(".codecov.yml"), @@ -203,6 +210,7 @@ pub async fn types(path: impl AsRef) -> HashSet { list.if_has_dir(".fossil-settings", ProjectType::Fossil), list.if_has_dir(".git", ProjectType::Git), list.if_has_dir(".hg", ProjectType::Mercurial), + list.if_has_dir(".svn", ProjectType::Subversion), list.if_has_file(".bzrignore", ProjectType::Bazaar), list.if_has_file(".ctags", ProjectType::C), list.if_has_file(".gitattributes", ProjectType::Git),