Using Mercurial Extensions
Expanding the basic functionality of Mercurial with optional extensions.
Contents
- Introduction
- Enabling an extension
- Extensions bundled with Mercurial
-
Extensions provided by others
- Management of branches and patches
- Nested repositories (subrepositories) and multi-repository operations
- Configuration management
- Authentication, access control and logging
- Interoperability with other VCS
- Code inspection and modifications
- Specific to a hosting service
- Specific to an operating system
- Issue tracking
- Code review
- Shortcuts
- Graphical interfaces
- Unclassified
- See also
1. Introduction
Mercurial is designed to offer a small, safe, and easy to use command set which is powerful enough for most users. Advanced users of Mercurial can be aided with the use of Mercurial extensions. Extensions allow the integration of powerful new features directly into the Mercurial core.
Features in extensions may not conform to Mercurial's usual standards for safety, reliability, and ease of use.
Built-in help on extensions is available with 'hg help extensions'. To get help about an enabled extension, run 'hg help <extension-name>'.
Note that Mercurial explicitly does not provide a stable API for extension programmers, so it is up to their respective providers/maintainers to adapt them to API changes.
2. Enabling an extension
To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your hgrc, like this:
[extensions] foo =
You may also specify the full path to an extension (which may be either a .py file or a folder containing __init__.py):
[extensions] myfeature = ~/.hgext/myfeature.py
To get an extension which is not shipped with Mercurial, just download it to any place in your filesystem. In the example above it was downloaded to ~/.hgext/. NB: On Windows, if the path refers to a directory then the trailing backwards slash must currently be omitted due to issue4187.
To explicitly disable an extension enabled in an hgrc of broader scope, prepend its path with !:
[extensions] # disabling extension bar residing in /path/to/extension/bar.py bar = !/path/to/extension/bar.py # ditto, but no path was supplied for extension baz baz = !
Extensions can often be configured further in an extension specific section in the same configuration file.
3. Extensions bundled with Mercurial
These extensions are maintained by the Mercurial project and are distributed together with Mercurial.
Name |
Page |
Description |
acl |
Manage commit access to parts of a repo using control lists |
|
blackbox |
Log events to .hg/blackbox.log for post-mortem debugging |
|
bugzilla |
Update Bugzilla entries when a bug id is referenced in a changeset |
|
censor |
Erase file content at a given revision |
|
churn |
Show change statistics for mercurial operations per author |
|
clonebundles |
Advertise pre-generated bundles to seed clones |
|
closehead |
Close arbitrary heads without checking them out first |
|
color |
(obsolete) Color output for the diff, status and qseries commands |
|
commitextras |
(advanced) Adds a new flag extras to commit |
|
convert |
Convert repositories from other SCMs into Mercurial |
|
eol |
Translate line-ending characters between working copy and repository |
|
extdiff |
Compare changes using external programs |
|
factotum |
HTTP authentication with factotum |
|
fastexport |
Export repositories as git fast-import stream |
|
fsmonitor |
Integrates the file-monitoring program watchman with Mercurial to produce faster status results. |
|
githelp |
try mapping git commands to Mercurial commands |
|
gpg |
Sign changesets and check signatures using GPG |
|
hgcia |
(dead) Send notifications to CIA |
|
hgk |
Graphical repository and history browser based on gitk |
|
highlight |
Highlight syntax in the file revision view of hgweb |
|
histedit |
Edit, fold, drop changesets in the style of git rebase --interactive |
|
keyword |
Use CVS like keyword expansion in tracked files |
|
largefiles |
Track large binary files (new in 2.0) |
|
mq |
Mercurial Patch Queues - manage changes as series of patches |
|
notify |
Send email to subscribed addresses to notify repository changes |
|
pager |
Allows you to choose a pager |
|
patchbomb |
Send a collection of changesets as a series of patch emails |
|
purge |
Purge all files and dirs in the repository that are not being tracked by Mercurial |
|
rebase |
Move revisions from a point to another |
|
relink |
Recreates hardlinks between repository clones |
|
schemes |
Add shortcuts to urls as url schemes |
|
share |
Share repository history between multiple repos |
|
shelve |
Save and restore changes to the working directory |
|
strip |
Strip changesets and their descendants from history |
|
transplant |
Cherry-picking, rebasing and changeset rewriting |
|
win32mbcs |
Allow to use shift_jis/big5 filenames on Windows. |
|
zeroconf |
Announce and browse repositories via zeroconf/bonjour |
3.1. Deprecated
These extensions are deprecated.
children |
Command to display child changesets |
|
fetch |
Pull, update and merge in one command |
|
graphlog |
Command to view revision graphs from a shell |
|
record |
Commands to interactively select changes for commit/qrefresh |
|
win32text |
Perform automatic newline conversion |
3.2. Experimental
These extensions are experimental.
absorb |
Apply working directory changes to changesets |
|
amend |
Provide the amend command |
|
automv |
Automatically detect file renames |
|
beautifygraph |
Beautify log -G output by using Unicode characters |
|
bookflow |
Implements bookmark-based branching |
|
fastannotate |
Yet another annotate implementation that might be faster |
|
fix |
Rewrite file content in changesets or working copy |
|
git |
Operate on Git repositories |
|
hooklib |
Simple hooks for common tasks |
|
infinitepush |
Store some pushes in a remote blob store on the server |
|
journal |
Track previous positions of bookmarks |
|
lfs |
lfs - large file support |
|
logtoprocess |
Send ui.log() data to a subproces |
|
narrowhg |
(hg help narrow) |
Download only part of the history, see NarrowClonePlan |
phabricator |
Simple Phabricator integration |
|
releasenotes |
Generate release notes from commit messages |
|
remotefilelog |
Allows clones that leave the majority of file history on the server. |
|
remotenames |
Track remote bookmarks and branches |
|
show |
Unified command to show various repository information |
|
sparse |
Allow sparse checkouts of the working directory |
|
split |
Command to split a changeset into smaller ones |
|
sqlitestore |
Store repository data in SQLite |
|
uncommit |
Uncommit part or all of a local changeset |
4. Extensions provided by others
These extensions are not distributed together with Mercurial. The Mercurial project provides no guarantees about these and does not maintain or test them.
Note that for extensions that were hosted on bitbucket and haven't moved somewhere else, you can find an archive at https://bitbucket-archive.softwareheritage.org
4.1. Management of branches and patches
attic |
Easily deal with individual patches |
|
bookbinder |
Make bookmarks behave like a feature branch (as opposed to a label) |
|
boundmode |
Enables a bound mode (commit command auto-pushes) |
|
branchhead |
Show head(s) of the branch the working directory or given revision is on |
|
changelog |
Auto-generate commit message from changelog entry |
|
commits |
Commit modified files as multiple changesets at once |
|
committer |
Record the committer when you are not the author of a changeset. |
|
collapse |
Collapse consecutive changesets into one |
|
diff-in-diffs |
Adds a new command to create the diff of two diffs |
|
easycommit |
Command-line GUI for committing changes |
|
easymerge |
Command-line GUI for merging |
|
editcommitmsgs |
Change commit messages for all applied mq patches in one go |
|
evolve |
History rewriting with second-order version control |
|
exportfiles |
Export all files changed in a revision or revision range to a directory. |
|
foreign |
Interactively register or delete foreign/unknown files |
|
forest |
Manage a bunch of mercurial repos as a meta repository, with snapshot support thread |
|
flow |
Support for the generalized Driessen's model |
|
hg-remotebranches |
Keeps track of remote branch heads for each entry in [paths] and exposes them as tags. |
|
histpush |
Record locally which revisions have been pushed |
|
importfs |
Imports a set of files from a given file-system into a Mercurial repository as a changeset |
|
lighttags |
Make local tags behave like lightweight tags (shared over clone and pull, not version controlled) |
|
mbox |
Import patches from unix mailboxes in MQ |
|
mergediff |
Show only the changes introduced by a merge |
|
mergeutil |
Useful utilities for merging branches |
|
mqcollab |
Manage patches in several parallel queues when working with others |
|
mutable-branches |
Rename named branches |
|
nearest |
Display the nearest tag from a given changeset |
|
localbranch |
Create clones inside your working directory |
|
lock |
Take locks on resources |
|
patience |
Generate diffs using Bram Cohen's patience diff algorithm |
|
pbranch |
Collaborative and/or long-term patch development and maintenance |
|
quiet-hg-branch |
Suppress the "did you want a bookmark?" hint for hg branch |
|
rebaseif |
Command that rebases only if there are no conflicts, otherwise does a merge |
|
release |
Automatize tasks to deal with release management (tag creation, archiving, ...) |
|
send |
Automatic send of bundle containing changesets missing on remote, like darcs send |
|
shared_mq |
SharedMQExtension |
Allow shared repositories have same MQ queues |
sync |
Perform pull, update/merge and push in a single click |
|
tasks |
Manage tasks as collections of contiguous changesets |
|
versions |
Display the version information for Mercurial and all installed extensions. |
4.2. Nested repositories (subrepositories) and multi-repository operations
guestrepo |
Handle nested repositories |
|
hgmod |
Yet another way working with subrepos |
|
hgnested |
Manage nested repositories |
|
hg-subtree |
A way to work with subrepositories by storing them inside the repository |
|
multirepo |
Allow commands to affect multiple repositories simultaneously |
|
onsub |
Recursively execute a command in each subrepository |
|
all_dirs |
Execute the same Mercurial command in all repositories down directory tree. |
4.3. Configuration management
cedit |
Command line editor for configuration files, never manually edit hgrc files again |
|
config |
Manage config files via command line only |
|
configexpress |
monitor and enforce client configuration from a server |
|
dynamic_username |
Set your username per directory tree. |
|
hgcfg |
Display or modify local, user, and global configuration. |
|
hgconfig |
(dead) Manage hgrc files via dialogs and command line |
|
path_pattern |
Define [paths] globally in your .hgrc (as patterns), and have them known all your repositories. |
|
projrc |
Parse project specific config from .hg/projrc |
|
rcpath |
Displays Mercurial configuration file paths and names |
|
reposettings |
Allow repo specific configuration from central configuration files |
4.4. Authentication, access control and logging
actionlog |
Provides hook intended to help keep track of a remote repository's state that multiple people have access to update |
|
commitsigs |
Embed GnuPG and OpenSSL signatures directly into changesets |
|
defpasswd |
Automatically provide credentials (username/passwords) read from a file. |
|
excludechangesets |
Exclude "bad" changesets from being re-added to a central repository |
|
hgban |
Ban specific changesets from being reintroduced to a repository after being stripped / removed. |
|
hg-kerberos |
Kerberos authentication extension by Henrik Stuart |
|
hgssoauthentication |
Allows you to use single sign-on authenticate with web servers that use NTLM or kerberos authentication. |
|
kerberos |
Kerberos Authentication over HTTP support |
|
keyring |
Securely save HTTP passwords in os-specific keyring (Gnome Keyring, KWallet, OSXKeyChain, encrypted file) |
|
nopush |
Prohibits pushes from predefined local repository directories |
|
pushlog |
Tracks who pushed what to a repository |
|
serverlog |
Log server-side events useful for sysadmins to diagnose what Mercurial is doing |
|
sonichg |
Record pushlog data, web interfaces to view pushlog & shortlog with slider, advanced search for pushlog, new file log page, full side-by-side diffs, regex filter, commit syntax warning and more! |
4.5. Interoperability with other VCS
cvscommit |
Push changesets to CVS |
|
fastimport |
Read a git "fast import" stream and turn it into changesets in a Mercurial repository |
|
hg-git |
Push to and pull from a Git server |
|
hgsubversion |
Use Mercurial as a Subversion client |
|
perfarce |
Allow Hg to pull from and push to a Perforce depot |
4.6. Code inspection and modifications
cloc |
Count lines of source code |
|
codesmell |
Ask before committing "smelly" changes |
|
update_version |
Automatically update version numbers in code while tagging. |
4.7. Specific to a hosting service
bitbucketize |
Create, modify, or delete BitBucket clone from command line |
|
hg-github |
Allow mirroring Mercurial repositories in Bitbucket to Github |
4.8. Specific to an operating system
tpager |
Mercurial pager with color support on Windows |
|
win32chcp |
Switches the Windows console into an encoding actually used by Mercurial on output. |
|
win32lfn |
Allow manipulating files with names longer than 260 characters on Windows. |
|
wincolor |
Support colors on Windows consoles. |
4.9. Issue tracking
artemis |
Simple and light-weight issue tracker |
|
b |
Distributed bug tracker based off the lightweight task manager t |
|
bugtracker |
A tiny distributed bugtracking extension for Mercurial |
|
hgtrac |
Mercurial/Trac Integration Hook (pre/post hooks for Trac/Mercurial) |
4.10. Code review
filereview |
Perform code review for any project using mercurial |
|
hgreview |
Upload / refresh and fetch patches from rietveld codereview instances |
|
reviewboard |
Post changesets for review to a Review Board server |
|
reviewassiatant |
Code review tool helps you to create review requests and respond to them without leaving Visual Studio |
4.11. Shortcuts
allpaths |
Run commands like push on multiple paths |
|
on_remote |
Easily execute Mercurial command on remote (ssh) repository |
4.12. Graphical interfaces
hgview |
Tool for visually navigating a repository history and comparing multiple revisions |
|
qct |
Provide access to the Qct commit tool |
4.13. Unclassified
Name |
Page |
Description |
activity |
Create an image representing the activity of the repository |
|
autopager |
Invoke pager when output is longer than one screen |
|
bfiles |
Handle large binary files |
|
bigfiles |
Support versions of big files with storage outside hg repo |
|
buglink |
Allow to link changesets and Issue IDs |
|
bundleclone |
Clone using pre-generated bundles |
|
casefold |
Successful unjams case-folding conflicts |
|
caseguard |
Prevents users from adding files to a repository if that could cause a CaseFolding collision |
|
casestop |
Stops case-folding conflicts on commit |
|
chart |
Display activity graphs (see also ActivityExtension and ChurnExtension) |
|
checkfiles |
Commit hook and command to check for and fix tabs and trailing whitespace |
|
checkmeta |
Enforces configurable file characteristics like file encoding. |
|
cifiles |
Print the names of all checked-in files |
|
contains |
Test whether a changset is contained in a branch |
|
crecord |
Select graphically which files/hunk/lines to commit |
|
cutehg |
A growing set of easy to install and use dialogs for mercurial commands |
|
deps |
Create and manage versioned repository dependencies |
|
digest |
Create and use small digest files for outgoing/bundle |
|
dotlog |
Yet Another DOT grapher |
|
dynapath |
Dynamically rewrite paths to use local mirrors based on current local IP. |
|
exclude |
Exclude some modified files by default (e.g., config files that are always modified) |
|
fixcase |
Fix problems where an external tool has changed the case of a filename |
|
fixrenames |
Replay old history to add rename information |
|
fixutf8 |
Fix problems on non-utf8 systems with filenames (Windows never supports utf8 filenames) |
|
ftp |
Manage uploaded snapshots on FTP server |
|
graphviz |
Generate DOT language source to visualize changeset tree |
|
group |
Allow to visually regroup a set of changesets |
|
grepfile |
Search files for a regular expression |
|
hgbb |
Several helpers for working with bitbucket.org repositories |
|
hgexternals |
Pull external repositories into a Mercurial repository |
|
hgext.markdown |
Markdown Extension for hgweb |
|
hgflowdock |
Send notifications to flowdock.com |
|
hglist |
An ls command for Mercurial |
|
hglock-le |
Allow users to inform each other in case of parallel file modification in one local repository |
|
hgopenurl |
Quickly show repository URLs in the browser |
|
hgsftp |
Use Mercurial over SFTP |
|
hgsite |
Serve a web site straight out of a Mercurial repository |
|
hgsql |
Allow server multi-mastering by using a MySQL backend. |
|
hg-textauth |
Plaintext file authentication |
|
hgwebcachingproxy |
Caching hgweb proxy, caches and serves pull requests locally, distributes load and gives good bandwidth utilization. |
|
hgxmpp |
Mercurial Jabber Notification Hook (pre/post hooks for Jabber/Mercurial) |
|
hotfiles |
Designates the files the most susceptible to contain issues |
|
info |
Display basic information about a repository |
|
infocalypse |
Share code efficiently, decentrally, anonymous and encrypted over Freenet |
|
killbom |
Remove BOM (byte-order mark) character from files with specified encodings prior to committing |
|
makewritable |
Interactively removes read-only flags from files |
|
moinport |
Fetch changes from MoinMoin Wiki |
|
pack |
Pack all files involved in the give revision (if your customer does not know what a diff file is) |
|
paste |
Paste changes to pastebin |
|
pastebin |
Paste changes to public and private pastebins |
|
prompt |
Put information about the current repository into a shell prompt |
|
publishall |
Publish to all your set repositories (ie: paths) |
|
punchcard |
Generate a "punch card" graph of your commit habits |
|
qtimes |
Save or restore modification times of files affected by patch queue |
|
qup |
Move MQ patches to top of unapplied part of series |
|
rdiff |
Allow diff to work against remote repositories |
|
rsync |
Keep your working directory in sync with remote files, that exist outside of the repository |
|
rupdate |
Update a remote repository to a specified revision if the remote repository is hosted via ssh |
|
snap |
Version (big) file snapshots with storage outside a Mercurial repository |
|
socks_proxy |
SOCKS proxy support |
|
softrebase |
Turn possibly complicated rebase calls into multiple simpler ones |
|
spellcheck |
Interactively correct spelling errors in commit messages; also includes a hook to reject changesets with spelling errors in their commit messages |
|
subpaths |
Manage subpath remappings using a central file, distributed on clone and pull |
|
talaria |
Manage simple hierarchical trees of HTML-documents, such as web-sites, documentation, etc |
|
terse-status |
Makes 'hg status' show ? foo/ when all files inside foo are untracked |
|
textful |
Convert binary file to text or handle character encoding when displaying |
|
tfs |
Update Team Foundation Server work items when bug ids are referenced in a changeset |
|
timestamp |
Saves and restores file timestamps |
|
timestamp_mod |
Automatically Saves and restores file timestamps for all files in the repository. |
|
timetracker |
Tracks the time spent on a project |
|
untouch |
Save or restore modification times of files |
|
webuserdir |
Host users' repositories under /~username/ on hgwebdir |
|
zipdoc |
Version control zipped document formats like docx or odt as uncompressed zip archives to improve delta compression. |
5. See also
WritingExtensions and PublishingExtensions for information on creating new extensions
ExtensionsDevel for core developer information about extensions