The repo broken, and no one knew why.
Mercurial had been running quietly for years. Commits piled up, branches spun off, merges hummed in the background. Then a small inconsistency appeared in production. A missing file here, an unexpected change there. Tracing it back wasn’t simple.
Auditing Mercurial is not a casual task. The tool is fast, distributed, and designed for flexibility—but that flexibility cuts both ways. The longer a codebase lives, the more hidden its history can become. Detecting errors early means knowing exactly how to dig into its guts, navigate every commit, and verify each change with precision.
The first step is understanding that Mercurial logs are only as useful as your ability to filter them. Using hg log with clear revision ranges and specific file paths turns a massive wall of history into a sharp timeline of intent. Pair it with templates to output metadata in formats that can be easily parsed by scripts or other audit tools.
Next, check integrity with hg verify. It inspects repository data, detecting corruption before it breaks workflows. For deeper analysis, hg diff across tagged releases reveals shifts in binary files, configuration changes, and creeping dependencies that may not appear in code reviews. Auditing is about both confirming what’s expected and exposing what’s not.