Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Mercurial

$ hg Official Med Risk
Mercurial · Code & DevOps · GPL-2.0 · macos / linux / windows

Mature 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.

FCRS-1.0 Score
79 /100
Good
Medium Confidence
Zero-Friction Install
brew install mercurial
CLI vs MCP Decision CLI Only

Primary VCS CLI; HGPLAIN=1 + hg log -T json is far faster and more expressive than an MCP wrapper.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

HGPLAIN=1, --noninteractive, revsets, and -T json templating provide first-class machine-readable scripting ergonomics.

  • HGPLAIN=1 guarantees stable unaliased output
  • -T json works across hg log, hg status, and hg branches
Trust & Safety 18 / 25

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 outgoing previews commits before hg push
Setup & Portability 12 / 15

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
Utility & Efficiency 12 / 15

Expressive revset query language and predictable subcommand design.

  • Revsets and filesets isolate exact changesets and paths
Maintenance & Lineage 8 / 10

Official Mercurial project under GPL-2.0 with decades of stability.

  • Official mercurial-scm.org project
Docs & Verifiability 8 / 10

Thorough built-in hg help documentation covering revsets, templates, and every command.

  • Comprehensive hg help topics and man pages

Security, Auth & Guardrails

Auth Modes
Config File OS Keychain
Credential Storage

Reads [auth] credentials from ~/.hgrc or delegates to SSH / OS keychain extensions.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

GPL-2.0 open-source DVCS; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Query repository status as JSON in plain mode
HGPLAIN=1 hg status -T json

Emits machine-readable JSON file statuses while disabling user aliases and localization.

Inspect recent commits with revsets and JSON template
HGPLAIN=1 hg log -l 10 -T json

Returns the latest 10 changesets as structured JSON without pager interference.

Controlled Writes & Previews

Create a commit non-interactively with explicit message
HGPLAIN=1 hg commit -m "fix: handle edge case" --noninteractive

Commits changes cleanly without triggering an editor or interactive prompt.

Strengths for Agents

  • + HGPLAIN=1 disables user ~/.hgrc customizations and pagers for deterministic agent behavior.
  • + Native -T json templating 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=1 can let user aliases, colorizers, or pagers break output parsing.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI