Mercurial エクステンションを使う
Mercurial の機能を任意のエクステンションで拡張しよう。
1. はじめに
Mercurial は安全で分かりやすいコマンドセットを提供しており、たいていのユーザーがその機能を満足できるように設計されています。 Mercurial のパワーユーザーはエクステンションを活用できるかもしれません。エクステンションを使うと、強力な新機能を Mercurial のコアに統合することができます。
エクステンションが提供する機能は、 Mercurial のポリシー、つまり、安全性、信頼性、使い易さを満たしていないかもしれません。
エクステンションのヘルプは 'hg help extensions' で表示できます。有効にしたエクステンションのヘルプを見るには、 'hg help <extension-name>' を実行してください。
2. エクステンションを有効にする
エクステンション "foo" を有効にするには、 そのエクステンションが Mercurial とともに配布されているか Python のサーチパスに含まれている場合は、 対応するエントリーを hgrc ファイルに追加してください。 例:
[extensions] foo =
エクステンションをフルパスで指定してもかまいません (.py ファイル名か __init__.py のあるフォルダ名):
[extensions] myfeature = ~/.hgext/myfeature.py
Mercurial と共に配布されていないエクステンションを使うには、ダウンロード後どこでも良いのでファイルシステム上に置いてください。この例では、 ~/.hgext/ にダウンロードしています。 注意: Windows 環境でディレクトリを指定する場合は、末尾にバックスラッシュをつけないでください。 (issue4187)
上位スコープの hgrc で有効になっているエクステンションを特に無効化したい場合は、 ! をパスの前に足してください:
[extensions] # /path/to/extension/bar.py にある bar エクステンションを無効化 bar = !/path/to/extension/bar.py # baz エクステンションのパスを指定しなくても同じこと baz = !
たいていのエクステンションは、同じ設定ファイル上の専用セクションで細かい設定ができるようになっています。
3. Mercurial とともに配布されているエクステンション
以下のエクステンションは Mercurial プロジェクトで保守・配布しています。
名称 |
ページ |
説明 |
acl |
コントロールリストをもとにリポジトリの一部へのコミットアクセスを制御 |
|
blackbox |
Log events to .hg/blackbox.log for post-mortem debugging |
|
bugzilla |
チェンジセットで Bugzilla の ID を参照していれば、エントリーを更新 |
|
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 |
|
color |
カラフルな diff, status, qseries コマンド |
|
convert |
他の SCM から Mercurial へリポジトリを変換 |
|
eol |
Translate line-ending characters between working copy and repository |
|
extdiff |
外部プログラムで変更内容を比較 |
|
factotum |
HTTP authentication with factotum |
|
fsmonitor |
Integrates the file-monitoring program watchman with Mercurial to produce faster status results. |
|
gpg |
GPG を使ったチェンジセットの署名とその検証 |
|
hgcia |
CIA に通知 |
|
hgk |
Graphical repository and history browser based on gitk |
|
highlight |
hgweb のファイルリビジョン表示でシンタックスハイライト |
|
histedit |
Edit, fold, drop changesets in the style of git rebase --interactive |
|
keyword |
管理中のファイルで CVS 風のキーワード展開 |
|
largefiles |
Track large binary files (new in 2.0) |
|
mq |
Mercurial パッチキュー - 変更内容を一連のパッチとして管理 |
|
notify |
リポジトリの変更を登録メールアドレスへお知らせ |
|
pager |
Allows you to choose a pager |
|
patchbomb |
チェンジセットを一連のパッチ email として送信 |
|
purge |
Mercurial で管理していないファイル・ディレクトリを消去 |
|
rebase |
リビジョンの分岐点を移動 |
|
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 |
Windows で shift_jis・big5 ファイル名を使う |
|
zeroconf |
Announce and browse repositories via zeroconf/bonjour |
4. 外部提供のエクステンション
エクステンションの一覧は常に更新されています。最新の情報は UsingExtensions (英語) を参照してください。
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 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.
actionlog |
Provides hook intended to help keep track of a remote repository's state that multiple people have access to update |
|
activity |
Create an image representing the activity of the repository |
|
all_dirs |
Execute the same Mercurial command in all repositories down directory tree. |
|
allpaths |
Run commands like push on multiple paths |
|
artemis |
Simple and light-weight issue tracker |
|
attic |
Easily deal with individual patches |
|
automv |
Automatically detect file renames |
|
autopager |
Invoke pager when output is longer than one screen |
|
b |
Distributed bug tracker based off the lightweight task manager t |
|
bfiles |
Handle large binary files |
|
bigfiles |
Support versions of big files with storage outside hg repo |
|
bitbucketize |
Create, modify, or delete BitBucket clone from command line |
|
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 |
|
buglink |
Allow to link changesets and Issue IDs |
|
bugtracker |
A tiny distributed bugtracking extension for Mercurial |
|
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 |
|
cedit |
Command line editor for configuration files, never manually edit hgrc files again |
|
changelog |
Auto-generate commit message from changelog entry |
|
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 |
|
cloc |
Count lines of source code |
|
codesmell |
Ask before committing "smelly" changes |
|
commits |
Commit modified files as multiple changesets at once |
|
commitsigs |
Embed GnuPG and OpenSSL signatures directly into changesets |
|
committer |
Record the committer when you are not the author of a changeset. |
|
collapse |
Collapse consecutive changesets into one |
|
configexpress |
monitor and enforce client configuration from a server |
|
config |
Manage config files via command line only |
|
config |
Manage hgrc files via dialogs and command line |
|
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 |
|
cvscommit |
Push changesets to CVS |
|
defpasswd |
Automatically provide credentials (username/passwords) read from a file. |
|
deps |
Create and manage versioned repository dependencies |
|
diff-in-diffs |
Adds a new command to create the diff of two diffs |
|
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. |
|
dynamic_username |
Set your username per directory tree. |
|
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 |
|
exportfiles |
Export all files changed in a revision or revision range to a directory. |
|
exclude |
Exclude some modified files by default (e.g., config files that are always modified) |
|
excludechangesets |
Exclude "bad" changesets from being re-added to a central repository |
|
fastimport |
Read a git "fast import" stream and turn it into changesets in a Mercurial repository |
|
filereview |
Perform code review for any project using mercurial |
|
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) |
|
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 |
|
ftp |
Manage uploaded snapshots on FTP server |
|
graphviz |
チェンジセットツリーを描くために DOT 言語のソースを生成 |
|
group |
Allow to visually regroup a set of changesets |
|
grepfile |
Search files for a regular expression |
|
guestrepo |
Handle nested repositories |
|
hgban |
Ban specific changesets from being reintroduced to a repository after being stripped / removed. |
|
hg-git |
Push to and pull from a Git server |
|
hg-github |
Allow mirroring Mercurial repositories in Bitbucket to Github |
|
hg-kerberos |
Kerberos authentication extension by Henrik Stuart |
|
hg-remotebranches |
Keeps track of remote branch heads for each entry in [paths] and exposes them as tags. |
|
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 |
|
hgmod |
Yet another way working with subrepos |
|
hgnested |
Manage nested repositories |
|
hgopenurl |
Quickly show repository URLs in the browser |
|
hgreview |
Upload / refresh and fetch patches from rietveld codereview instances |
|
hgsftp |
Use Mercurial over SFTP |
|
hgsite |
Serve a web site straight out of a Mercurial repository |
|
hgssoauthentication |
Allows you to use single sign-on authenticate with web servers that use NTLM or kerberos authentication. |
|
hgsql |
Allow server multi-mastering by using a MySQL backend. |
|
hgsubversion |
Use Mercurial as a Subversion client |
|
hgview |
Tool for visually navigating a repository history and comparing multiple revisions |
|
hg-textauth |
Plaintext file authentication |
|
hgtrac |
Mercurial/Trac Integration Hook (pre/post hooks for Trac/Mercurial) |
|
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) |
|
histpush |
Record locally which revisions have been pushed |
|
hotfiles |
Designates the files the most susceptible to contain issues |
|
importfs |
Imports a set of files from a given file-system into a Mercurial repository as a changeset |
|
info |
Display basic information about a repository |
|
infocalypse |
Share code efficiently, decentrally, anonymous and encrypted over Freenet |
|
kerberos |
Kerberos Authentication over HTTP support |
|
keyring |
Securely save HTTP passwords in os-specific keyring (Gnome Keyring, KWallet, OSXKeyChain, encrypted file) |
|
killbom |
Remove BOM (byte-order mark) character from files with specified encodings prior to committing |
|
lighttags |
Make local tags behave like lightweight tags (shared over clone and pull, not version controlled) |
|
localbranch |
Create clones inside your working directory |
|
lock |
Take locks on resources |
|
makewritable |
Interactively removes read-only flags from files |
|
mbox |
Import patches from unix mailboxes in MQ |
|
mergediff |
Show only the changes introduced by a merge |
|
mergeutil |
Useful utilities for merging branches |
|
moinport |
Fetch changes from MoinMoin Wiki |
|
mqcollab |
Manage patches in several parallel queues when working with others |
|
multirepo |
Allow commands to affect multiple repositories simultaneously |
|
mutable-branches |
Rename named branches |
|
nearest |
Display the nearest tag from a given changeset |
|
onsub |
Recursively execute a command in each subrepository |
|
nopush |
Prohibits pushes from predefined local repository directories |
|
pack |
Pack all files involved in the give revision (if your customer does not know what a diff file is) |
|
path_pattern |
Define [paths] globally in your .hgrc, and have them known all your repositories. |
|
paste |
Paste changes to pastebin |
|
pastebin |
Paste changes to public and private pastebins |
|
patience |
Generate diffs using Bram Cohen's patience diff algorithm |
|
pbranch |
Collaborative and/or long-term patch development and maintenance |
|
perfarce |
Allow Hg to pull from and push to a Perforce depot |
|
projrc |
Parse project specific config from .hg/projrc |
|
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 |
|
pushlog |
Tracks who pushed what to a repository |
|
quiet-hg-branch |
Suppress the "did you want a bookmark?" hint for hg branch |
|
release |
Automatize tasks to deal with release management (tag creation, archiving, ...) |
|
reviewboard |
Post changesets for review to a Review Board server |
|
qct |
Provide access to the Qct commit tool |
|
qtimes |
Save or restore modification times of files affected by patch queue |
|
qup |
Move MQ patches to top of unapplied part of series |
|
rcpath |
Displays Mercurial configuration file paths and names |
|
rdiff |
Allow diff to work against remote repositories |
|
rebaseif |
Command that rebases only if there are no conflicts, otherwise does a merge |
|
remotefilelog |
Allows clones that leave the majority of file history on the server. |
|
remotenames |
Track remote bookmarks and branches |
|
reposettings |
Allow repo specific configuration from central configuration files |
|
reviewassiatant |
Code review tool helps you to create review requests and respond to them without leaving Visual Studio |
|
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 |
|
send |
Automatic send of bundle containing changesets missing on remote, like darcs send |
|
serverlog |
Log server-side events useful for sysadmins to diagnose what Mercurial is doing |
|
shared_mq |
SharedMQExtension |
Allow shared repositories have same MQ queues |
shelve |
Interactively select changes to set aside |
|
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 |
|
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! |
|
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 |
|
sync |
Perform pull, update/merge and push in a single click |
|
talaria |
Manage simple hierarchical trees of HTML-documents, such as web-sites, documentation, etc |
|
tasks |
Manage tasks as collections of contiguous changesets |
|
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 |
|
tpager |
Mercurial pager with color support on Windows |
|
untouch |
Save or restore modification times of files |
|
update_version |
Automatically update version numbers in code while tagging. |
|
versions |
Display the version information for Mercurial and all installed extensions. |
|
webuserdir |
Host users' repositories under /~username/ on hgwebdir |
|
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. |
|
zipdoc |
Version control zipped document formats like docx or odt as uncompressed zip archives to improve delta compression. |
5. 参考
JapaneseWritingExtensions and PublishingExtensions for information on creating new extensions
ExtensionsDevel for core developer information about extensions