summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorcashmere <cashmere1337@riseup.net>2026-09-23 00:10:34 +0200
committercashmere <cashmere1337@riseup.net>2026-09-23 00:10:34 +0200
commit4b4af818d1e95449b635cc15b92f946c3d023edd (patch)
treeccb909be04216be98fe32fccda8599ba4542f0a1 /bin
parentbf6a1d2dbc6147166272eca0276443779012e925 (diff)
downloademacs-4b4af818d1e95449b635cc15b92f946c3d023edd.tar.gz
relic: 2026-09-23T00:10:38+02:00
Diffstat (limited to 'bin')
-rwxr-xr-xbin/project-ctags27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/project-ctags b/bin/project-ctags
index 47b1fe5..373a712 100755
--- a/bin/project-ctags
+++ b/bin/project-ctags
@@ -180,9 +180,36 @@ def git_project_files(root):
return files
+def fossil_project_files(root):
+ """List managed and unignored files of a Fossil checkout."""
+ fossil = shutil.which("fossil")
+ if fossil is None:
+ return None
+ files = []
+ for command in (["ls"], ["extras"]):
+ result = subprocess.run(
+ [fossil, *command],
+ cwd=root,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.DEVNULL,
+ check=False,
+ )
+ if result.returncode != 0:
+ return None
+ for name in result.stdout.splitlines():
+ if not name:
+ continue
+ path = root / os.fsdecode(name)
+ if path.is_file():
+ files.append(path.resolve())
+ return files
+
+
def project_files(root, output):
files = git_project_files(root)
if files is None:
+ files = fossil_project_files(root)
+ if files is None:
files = walk_files(root)
return sorted(path for path in files if path != output)