Repository navigation
fix(tools/fossil, tools/vcs): detect Fossil checkouts by .fslckout - #1494
Conversation
Fossil names its checkout database `.fslckout` on POSIX systems and `_FOSSIL_` on native Windows builds. Both checkout probes looked for `.fslckg`, a name Fossil never writes, so `tools/vcs` did not detect a Fossil checkout on Linux or macOS, and the Fossil bridge could not resolve the repository database from one. The vcs test fixture used the same misspelled name, so the suite passed. Adds a test that resolves the repository through a `.fslckout` database, and corrects the marker name in the Fossil README. Signed-off-by: Davide Polato <dpol1@apache.org>
potiuk
left a comment
There was a problem hiding this comment.
Correct, complete fix: every .fslckg probe in the tree now looks for Fossil's real POSIX checkout database .fslckout, and the corrected fixture plus the new find_repo_db test cover both code paths.
The new test resolves from a nested sub/ directory, so it pins the parent walk as well as the marker name. A follow-up test against a real fossil open (skipped when the binary is absent, like the Mercurial tests) would tie the marker to Fossil itself, as you noted — not needed for this PR.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
CONTRIBUTING.md.
Summary
tools/vcs(FossilBackend.detect()) andtools/fossil(find_repo_db()) looked for a checkout file named.fslckg. Fossil never writes that name: its glossary says the checkout database "is in the.fslckoutfile on POSIX type systems, but for historical compatibility reasons, it's called_FOSSIL_by native Windows builds of Fossil."tools/vcs, and the Fossil bridge could not resolve the repository from the checkout. Native Windows checkouts matched through_FOSSIL_and are unchanged..fslckout, and a new test resolves the repository through a.fslckoutdatabase.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)tools/fossil/README.mdTest plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses (tools/fossil: 28 passed;tools/vcs: 21 passed)test_detect_marks_hg_svn_fossilwith the corrected fixture, and the newtest_find_repo_db_reads_fslckout), then pass with it.RFC-AI-0004 compliance
No principle touched: the change renames a file marker and its test fixture.
Linked issues
None. Filed as a direct PR because the fix is a two-line rename plus tests.
Notes for reviewers (optional)
The tests use a hand-built
.fslckoutfile and SQLite database rather than a realfossil open, as the existing fixture does. A test against the real binary (skipped whenfossilis not installed, like the Mercurial tests) would check the marker against Fossil itself; I left it out to keep this PR to the rename.