Mercurial
$ hg Official Med RiskMature distributed version control system featuring consistent subcommands, expressive revset queries, HGPLAIN=1 scripting mode, and native -T json templating across read commands. Requires Python runtime and careful handling of history-editing extensions.
brew install mercurial Primary VCS CLI; HGPLAIN=1 + hg log -T json is far faster and more expressive than an MCP wrapper.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
HGPLAIN=1, --noninteractive, revsets, and -T json templating provide first-class machine-readable scripting ergonomics.
HGPLAIN=1guarantees stable unaliased output-T jsonworks acrosshg log,hg status, andhg branches
Immutable changeset model by default, though remote push and extensions like rebase/strip lack a global --dry-run (only specific commands like hg incoming/outgoing preview transfers).
hg outgoingpreviews commits beforehg push
Available on macOS, Linux, and Windows, though typically depends on Python unless installed via platform-specific bundles.
- Python-based CLI distributed via Homebrew, PyPI, and OS packages
Expressive revset query language and predictable subcommand design.
- Revsets and filesets isolate exact changesets and paths
Official Mercurial project under GPL-2.0 with decades of stability.
- Official
mercurial-scm.orgproject
Thorough built-in hg help documentation covering revsets, templates, and every command.
- Comprehensive
hg helptopics and man pages
Security, Auth & Guardrails
Reads [auth] credentials from ~/.hgrc or delegates to SSH / OS keychain extensions.
GPL-2.0 open-source DVCS; completely free.
# Mercurial (hg) Agent Rules - Always prefix commands with `HGPLAIN=1` and pass `--noninteractive` (`-y`) in automation. - Use `-T json` on `hg status` and `hg log` to get structured JSON output. - Never run `hg push` or history-rewriting commands (`rebase`, `strip`) without explicit approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
HGPLAIN=1 hg status -T json
Emits machine-readable JSON file statuses while disabling user aliases and localization.
HGPLAIN=1 hg log -l 10 -T json
Returns the latest 10 changesets as structured JSON without pager interference.
Controlled Writes & Previews
HGPLAIN=1 hg commit -m "fix: handle edge case" --noninteractive
Commits changes cleanly without triggering an editor or interactive prompt.
Strengths for Agents
- +
HGPLAIN=1disables user~/.hgrccustomizations and pagers for deterministic agent behavior. - + Native
-T jsontemplating and revset queries make read operations highly token-efficient.
Caveats & Pitfalls
- ! Requires Python runtime and is far less common than Git in modern OSS workflows.
- ! Missing
HGPLAIN=1can let user aliases, colorizers, or pagers break output parsing.