Reportingversion controldistributed scmsource code managementrepositoryhg

Mercurial

Mercurial is a fast, lightweight, scalable distributed version control system designed for efficient handling of very large projects. It provides an easy-to-use command-line interface and integrated web interface for managing source code repositories.

Description

Mercurial is a distributed Source Control Management (SCM) system optimized for large-scale projects. It supports decentralized development with features like arbitrary merging between trees, robust SHA1-based integrity checking, and append-only storage. The tool is particularly suited for teams needing efficient exploration of project history through complete cross-indexing of files and changesets.

Use cases include repository creation and management, change tracking, merging branches, and maintaining project integrity. It excels in environments requiring high-speed operations, such as pulling/pushing changes over HTTP, annotating files, and generating diffs. Mercurial's small Python codebase ensures lightweight deployment.

The package 'mercurial' contains architecture-dependent files, while 'mercurial-common' provides shared components. A faster wrapper 'chg' is also available, offering the same command set with improved performance.

How It Works

Mercurial uses an O(1) delta-compressed file storage and retrieval scheme for efficiency. It employs robust SHA1-based integrity checking and an append-only storage model. Changesets are fully cross-indexed for fast history exploration, supporting a decentralized model with high-speed HTTP-based network merge protocol. Commands operate on working directories, repositories, and remotes, with features like phases, bookmarks, and evolution for history management.

Installation

bash
sudo apt install mercurial

Examples

Display help for Mercurial Distributed SCM, listing all available commands grouped by category
chg -h
Show basic help overview for hg command
hg -h
Make a copy of an existing repository
chg clone
Create a new repository in the given directory
chg init
Pull changes from the specified source
chg pull
Push changes to the specified destination
chg push
Commit the specified files or all outstanding changes
chg commit
Show changed files in the working directory
chg status
Updated 2026-04-16kali.org ↗