[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/projectile 0b9c9e8025 1/2: Add Sapling support (#1875)
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/projectile 0b9c9e8025 1/2: Add Sapling support (#1875) |
Date: |
Mon, 15 Jan 2024 07:01:04 -0500 (EST) |
branch: elpa/projectile
commit 0b9c9e802527dec8d0ed62167b380fb7524aa64f
Author: Zeyi (Rice) Fan <github@zeyi.fan>
Commit: GitHub <noreply@github.com>
Add Sapling support (#1875)
Sapling is a Meta maintained fork of Mercurial. It uses .sl as the state
directory instead of .hg to avoid compatibility issues with Mercurial. See this
page for comparison with Mercurial:
https://sapling-scm.com/docs/introduction/differences-hg
---
CHANGELOG.md | 1 +
doc/modules/ROOT/pages/faq.adoc | 2 +-
doc/modules/ROOT/pages/projects.adoc | 1 +
doc/modules/ROOT/pages/usage.adoc | 2 +-
projectile.el | 12 +++++++++++-
5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5fcb7b653..132ef64202 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## master (unreleased)
* [#1870](https://github.com/bbatsov/projectile/pull/1870): Add package
command for CMake projects.
+* [#1875](https://github.com/bbatsov/projectile/pull/1875): Add support for
Sapling VCS.
## 2.8.0 (2023-10-13)
diff --git a/doc/modules/ROOT/pages/faq.adoc b/doc/modules/ROOT/pages/faq.adoc
index 62166c8b37..7a930ab842 100644
--- a/doc/modules/ROOT/pages/faq.adoc
+++ b/doc/modules/ROOT/pages/faq.adoc
@@ -59,7 +59,7 @@ automatically used when appropriate to improve performance.
Inside version control repositories, VC tools are used when installed
to list files more efficiently. The supported tools include git, hg,
-fossil, bzr, darcs, pijul, and svn.
+fossil, bzr, darcs, pijul, svn, and sapling.
Outside version control repositories, file search tools are used when
installed for a faster search than pure Elisp. The supported tools
diff --git a/doc/modules/ROOT/pages/projects.adoc
b/doc/modules/ROOT/pages/projects.adoc
index f3db50d8f1..17824c9031 100644
--- a/doc/modules/ROOT/pages/projects.adoc
+++ b/doc/modules/ROOT/pages/projects.adoc
@@ -31,6 +31,7 @@ a project. Out of the box Projectile supports:
* CVS
* Fossil
* Darcs
+* Sapling
=== File markers
diff --git a/doc/modules/ROOT/pages/usage.adoc
b/doc/modules/ROOT/pages/usage.adoc
index 0dca9cbe53..59f78126db 100644
--- a/doc/modules/ROOT/pages/usage.adoc
+++ b/doc/modules/ROOT/pages/usage.adoc
@@ -52,7 +52,7 @@ automatically used when appropriate to improve performance.
Inside version control repositories, VC tools are used when installed
to list files more efficiently. The supported tools include git, hg,
-fossil, bzr, darcs, pijul, and svn.
+fossil, bzr, darcs, pijul, svn, and sapling.
Outside version control repositories, file search tools are used when
installed for a faster search than pure Elisp. The supported tools
diff --git a/projectile.el b/projectile.el
index 7892b8c75f..7057405249 100644
--- a/projectile.el
+++ b/projectile.el
@@ -331,6 +331,7 @@ See `projectile-register-project-type'."
".bzr" ; Bazaar VCS root dir
"_darcs" ; Darcs VCS root dir
".pijul" ; Pijul VCS root dir
+ ".sl" ; Sapling VCS root dir
)
"A list of files considered to mark the root of a project.
The bottommost (parentmost) match has precedence."
@@ -424,7 +425,8 @@ is set to `alien'."
"^\\.stack-work$"
"^\\.ccls-cache$"
"^\\.cache$"
- "^\\.clangd$")
+ "^\\.clangd$"
+ "^\\.sl$")
"A list of directories globally ignored by projectile.
Regular expressions can be used.
@@ -723,6 +725,11 @@ Set to nil to disable listing submodules contents."
:group 'projectile
:type 'string)
+(defcustom projectile-sapling-command "sl locate -0 -I ."
+ "Command used by projectile to get the files in a Sapling project."
+ :group 'projectile
+ :type 'string)
+
(defcustom projectile-fossil-command (concat "fossil ls | "
(when (string-equal system-type
"windows-nt")
@@ -1460,6 +1467,7 @@ Fallback to a generic command when not in a
VCS-controlled project."
('darcs projectile-darcs-command)
('pijul projectile-pijul-command)
('svn projectile-svn-command)
+ ('sapling projectile-sapling-command)
(_ projectile-generic-command)))
(defun projectile-get-sub-projects-command (vcs)
@@ -3649,6 +3657,7 @@ the variable `projectile-project-root'."
((projectile-file-exists-p (expand-file-name "_darcs" project-root)) 'darcs)
((projectile-file-exists-p (expand-file-name ".pijul" project-root)) 'pijul)
((projectile-file-exists-p (expand-file-name ".svn" project-root)) 'svn)
+ ((projectile-file-exists-p (expand-file-name ".sl" project-root)) 'sapling)
;; then we check if there's a VCS marker up the directory tree
;; that covers the case when a project is part of a multi-project repository
;; in those cases you can still the VCS to get a list of files for
@@ -3661,6 +3670,7 @@ the variable `projectile-project-root'."
((projectile-locate-dominating-file project-root "_darcs") 'darcs)
((projectile-locate-dominating-file project-root ".pijul") 'pijul)
((projectile-locate-dominating-file project-root ".svn") 'svn)
+ ((projectile-locate-dominating-file project-root ".sl") 'sapling)
(t 'none)))
(defun projectile--test-name-for-impl-name (impl-file-path)