# Install mercurial with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, scoop, winget, zypper, chocolatey

Scalable distributed version control system. Version 7.2.3 via Homebrew; verified 2026-06-29.

## Install

```sh
sudo av install brew:mercurial
```

## Agent safety answer

mercurial mutates source-control repositories and remote history.

- **Credential access:** Reads repository config, credential helpers, auth files, and local history.
- **Remote mutation:** Can push changesets, tags, bookmarks, and remote repository changes.
- **Publish/artifact risk:** Can publish source changes and release tags.
- **Recommended control:** Gate pushes, credential reads, destructive history operations, and tag creation.
- **Agent-use guidance:** Allow status/log/diff; require approval for pushes, credential use, and history rewrites.

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install mercurial
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mercurial
```

  Evidence: MacPorts ports tree: devel/mercurial/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add mercurial
```

  Evidence: Alpine Linux edge package indexes: mercurial from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install mercurial
```

  Evidence: Debian stable package indexes: mercurial from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install mercurial
```

  Evidence: Fedora Rawhide package metadata: mercurial from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#mercurial
```

  Evidence: nixpkgs package indexes: pkgs/by-name/me/mercurial/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S mercurial
```

  Evidence: Arch Linux sync databases: mercurial from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install mercurial
```

  Evidence: openSUSE Tumbleweed package metadata: mercurial from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/mercurial
```

  Evidence: Scoop official bucket manifest trees: bucket/mercurial.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Mercurial.Mercurial -e
```

  Evidence: Windows Package Manager source index: Mercurial.Mercurial from https://cdn.winget.microsoft.com/cache/source.msix

- Chocolatey (92%):

```sh
choco install hg
```

  Evidence: Chocolatey community package catalog: hg from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','hexchat'

## Package facts

- **Package key:** brew:mercurial
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/mercurial>
- **Version:** 7.2.3
- **Source summary:** Scalable distributed version control system
- **Homepage:** <https://mercurial-scm.org/>
- **Repository:** <https://foss.heptapod.net/mercurial/mercurial-devel>
- **Upstream docs:** <https://www.mercurial-scm.org/>
- **License:** GPL-2.0-or-later
- **Source archive:** <https://www.mercurial-scm.org/release/mercurial-7.2.3.tar.gz>
- **Last updated:** 2026-06-29T18:50:44Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- chg (cli)
- hg (cli)
- chg (alias)
- hg (alias)

## Dependencies

- python@3.14

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sequoia, sonoma, tahoe, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 7.2.3
- Package-manager updated: 2026-06-29
- Local data: ok
- Upstream repository: https://mercurial-scm.org/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

Mercurial is a distributed source-control management system invoked mainly through the hg command. Matt Mackall, later Olivia Mackall, started it in April 2005 after Linux kernel developers lost the free BitKeeper arrangement. The Architecture of Open Source Applications describes Mercurial and Git as parallel 2005 responses to the need for a scalable distributed VCS capable of handling large kernel-sized histories; it also notes Mackall's early goals of simplicity, scalability, and efficiency.

### Project history

Technically, Mercurial stores project history as a distributed graph of changesets. Like Git, it uses SHA-1-derived changeset identifiers, but it emphasizes a comparatively small, coherent command set and a clone model where most operations are local. The official Mercurial site positions it as a free distributed SCM that handles projects of any size, supports many workflows, and can be extended.

### Adoption history

Mercurial's adoption history is strongly tied to large repositories and to teams that valued a scriptable CLI with a less sprawling user model than Git. Facebook selected Mercurial while replacing a Subversion server plus Git mirror, then published work on scaling it for a repository with thousands of weekly commits and hundreds of thousands of files. That scaling lineage later connected to Mononoke and Sapling: Meta's Sapling README says Sapling's CLI was originally based on Mercurial and shares aspects of Mercurial's UI and features, while Mononoke is described as a Mercurial source-control server for large monorepos.

### How it is used

For package managers, Mercurial is a classic cross-platform developer tool rather than an application-specific CLI. It appears across Homebrew, Debian, Ubuntu, Fedora, Arch, Nix, MacPorts, Windows package managers, and others, with hg as the primary executable and chg as a command server client for faster repeated commands.

### Sources

- <https://aosabook.org/en/v1/mercurial.html>
- <https://engineering.fb.com/2014/01/07/core-infra/scaling-mercurial-at-facebook/>
- <https://github.com/facebook/sapling>
- <https://github.com/facebookarchive/mononoke>
- <https://www.mercurial-scm.org/>


## Security Notes

No matching local secret-handling manifest was found for mercurial. Nucleus package metadata is still published here so future coverage has a stable package URL.



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.hgrc, $XDG_CONFIG_HOME/hg/hgrc, ~/.config/hg/hgrc

## Credential files

- Unix: ~/.hgrc, $XDG_CONFIG_HOME/hg/hgrc, ~/.config/hg/hgrc
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** mercurial
- **Aliases:** hg
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - mercurial - 7.0.1-2: normalized package name match | Debian stable package indexes: mercurial from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | easy-to-use, scalable distributed version control system | https://www.mercurial-scm.org/
- Debian apt - mercurial-common - 7.0.1-2: normalized package name match | Debian stable package indexes: mercurial-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | easy-to-use, scalable distributed version control system (common files) | https://www.mercurial-scm.org/
- Nix - mercurial: normalized package name match | nixpkgs package indexes: pkgs/by-name/me/mercurial/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - mercurial - 6.7.2-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: mercurial from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | easy-to-use, scalable distributed version control system | https://www.mercurial-scm.org/
- Ubuntu apt - mercurial-common - 6.7.2-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: mercurial-common from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | easy-to-use, scalable distributed version control system (common files) | https://www.mercurial-scm.org/
- apk - mercurial - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Scalable distributed SCM tool | https://www.mercurial-scm.org/
- apk - mercurial-bash-completion - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for mercurial | https://www.mercurial-scm.org/
- apk - mercurial-chg - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-chg from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Client for Mercurial command server with cHg extension | https://www.mercurial-scm.org/
- apk - mercurial-doc - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Scalable distributed SCM tool (documentation) | https://www.mercurial-scm.org/
- apk - mercurial-lang - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-lang from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | translations for mercurial | https://www.mercurial-scm.org/
- apk - mercurial-pyc - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for mercurial | https://www.mercurial-scm.org/
- apk - mercurial-vim - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-vim from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Vim syntax for mercurial | https://www.mercurial-scm.org/
- apk - mercurial-zsh-completion - 7.2.1-r0: normalized package name match | Alpine Linux edge package indexes: mercurial-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for mercurial | https://www.mercurial-scm.org/
- dnf - mercurial - 7.2.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: mercurial from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A fast, lightweight Source Control Management system | https://mercurial-scm.org/
- dnf - mercurial-chg - 7.2.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: mercurial-chg from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A fast Mercurial command without slow Python startup | https://mercurial-scm.org/
- dnf - mercurial-hgk - 7.2.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: mercurial-hgk from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Hgk interface for mercurial | https://mercurial-scm.org/


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [git-cinnabar](https://www.automicvault.com/pkg/brew/git-cinnabar/) - Popular package that depends on this formula.
- [hg-fast-export](https://www.automicvault.com/pkg/brew/hg-fast-export/) - Popular package that depends on this formula.
- [breezy](https://www.automicvault.com/pkg/brew/breezy/) - Shares av.db curated category or tags: cli, developer-tools, distributed-vcs, python, version-control.
- [cvs](https://www.automicvault.com/pkg/brew/cvs/) - Shares av.db curated category or tags: cli, developer-tools, scm, version-control.
- [darcs](https://www.automicvault.com/pkg/brew/darcs/) - Shares av.db curated category or tags: cli, developer-tools, distributed-vcs, version-control.
- [fossil](https://www.automicvault.com/pkg/brew/fossil/) - Shares av.db curated category or tags: cli, developer-tools, scm, version-control.
- [git](https://www.automicvault.com/pkg/brew/git/) - Shares av.db curated category or tags: cli, developer-tools, distributed-vcs, version-control.
- [jj](https://www.automicvault.com/pkg/brew/jj/) - Shares av.db curated category or tags: cli, developer-tools, scm, version-control.
- [pygitup](https://www.automicvault.com/pkg/brew/pygitup/) - Shares av.db curated category or tags: cli, developer-tools, python, version-control.

## Combined YAML source

View the package source record on GitHub. [combined/mercurial.yml](https://github.com/automic-vault/db/blob/main/combined/mercurial.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
