# mercurial を Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget, chocolatey でインストール

mercurial のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

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

## エージェント安全性の回答

mercurial mutates source-control repositories and remote history.

- **認証情報アクセス:** Reads repository config, credential helpers, auth files, and local history.
- **リモート変更:** Can push changesets, tags, bookmarks, and remote repository changes.
- **公開/成果物リスク:** Can publish source changes and release tags.
- **推奨コントロール:** Gate pushes, credential reads, destructive history operations, and tag creation.
- **エージェント利用ガイダンス:** Allow status/log/diff; require approval for pushes, credential use, and history rewrites.

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install mercurial
```

  証拠: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mercurial
```

  証拠: 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
```

  証拠: 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
```

  証拠: 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
```

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

- Nix (92%):

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

  証拠: 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
```

  証拠: 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
```

  証拠: openSUSE Tumbleweed package metadata: mercurial from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

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

  証拠: 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
```

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

- Chocolatey (92%):

```sh
choco install hg
```

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

## パッケージ情報

- **パッケージキー:** brew:mercurial
- **パッケージマネージャ:** Homebrew
- **バージョン:** 7.2.3
- **ソース概要:** Scalable distributed version control system
- **ホームページ:** <https://mercurial-scm.org/>
- **最終更新:** 2026-06-29T18:50:44Z
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- chg (エイリアス)
- hg (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 7.2.3
## プロジェクトの歴史と使われ方

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.

### プロジェクトの歴史

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.

### 採用の歴史

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.

### 使われ方

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.

### ソース

- <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/>


## セキュリティノート

mercurial に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、Nucleus パッケージメタデータはここに公開されています。



## 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
## 他のパッケージマネージャ記録

- 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.3-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.3-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.3-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.3-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.3-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.3-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.3-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.3-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.3-5.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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A fast, lightweight Source Control Management system | https://mercurial-scm.org/
- dnf - mercurial-chg - 7.2.3-5.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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A fast Mercurial command without slow Python startup | https://mercurial-scm.org/
- dnf - mercurial-hgk - 7.2.3-5.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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Hgk interface for mercurial | https://mercurial-scm.org/


## Combined YAML source

View the package source record on GitHub. [combined/mercurial.yml](https://github.com/mxcl/pkgdb/blob/main/combined/mercurial.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
