Code Tools: trees
The trees
Mercurial extension helps manage
loosely-coupled nested repositories (aka 'trees').
A 'tree' is simply a repository that may contain other
repositories (or other trees) nested within its working directory.
This extension provides commands that operate on an entire tree, or
on selected trees within it. For example, the command hg
tpull
will pull changes into each repo in a tree.
The trees
extension will soon be enabled on the
OpenJDK Mercurial server; to
enable it for your copy of Mercurial:
- Download
trees.py
and save it somewhere convenient. (Alternatively, you can clone the trees respository.) - Add a line to the [extensions] section of your ~/.hgrc file:
trees = <path_to_your_copy>/trees.py
Mercurial compatibility
Mercurial version 1.6 or later is required for complete functionality, although most features work with versions 1.1 and later. Versions prior to 1.1 are not supported. The extension uses 'pushkey' support, added in Mercurial 1.6, to automatically discover the subtree configuration of a remote repository (i.e., one accessed via http or ssh). It also uses utility methods added in 1.6 to properly split quoted configuration items.
Thus when used with Mercurial versions 1.1 - 1.5.4, the following features are not available:
- automatic discovery of the subtree configuration for remote
(http, ssh) repos
- workaround: explicitly specify the list of subtrees when
cloning, e.g.,
hg tclone http://hg.openjdk.org/jdk8/jdk8 myjdk8 corba jaxp jaxws ...
- workaround: explicitly specify the list of subtrees when
cloning, e.g.,
- accurate splitting of quoted config items when
trees.splitargs=True
- quoted config items are needed only if subtree names contain whitespace, so this occurs rarely
- workaround: set
trees.splitargs=False
in your ~/.hgrc file and use a separate --subtrees argument for each subtree
- the tdebugkeys command, which lists the subtree configuration of a remote (http, ssh) repository
Examples
- Clone the jdk9 development tree:
hg tclone http://hg.openjdk.org/jdk9/dev my-jdk9-dev
- Get the status of all repos in the tree:
hg tstatus
- Check for incoming changes:
hg tincoming
- Check for outgoing changes:
hg toutgoing
Further information
- Built-in help -
hg help trees
- Source repository
- Mailing list
- Open Issues