##// END OF EJS Templates
hg: support for auto sharing stores when cloning...
hg: support for auto sharing stores when cloning Many 3rd party consumers of Mercurial have created wrappers to essentially perform clone+share as a single operation. This is especially popular in automated processes like continuous integration systems. The Jenkins CI software and Mozilla's Firefox release automation infrastructure have both implemented custom code that effectively perform clone+share. The common use case here is that clients want to obtain N>1 checkouts while minimizing disk space and network requirements. Furthermore, they often don't care that a clone is an exact mirror of a remote: they are simply looking to obtain checkouts of specific revisions. When multiple third parties implement a similar feature, it's a good sign that the feature is worth adding to the core product. This patch adds support for an easy-to-use clone+share feature. The internal "clone" function now accepts options to control auto sharing during clone. When the auto share mode is active, a store will be created/updated under the base directory specified and a new repository pointing to the shared store will be created at the path specified by the user. The share extension has grown the ability to pass these options into the clone command/function. No command line options for this feature are added because we don't feel the feature will be popular enough to warrant their existence. There are two modes for auto share mode. In the default mode, the shared repo is derived from the first changeset (rev 0) in the remote repository. This enables related repositories existing at different URLs to automatically use the same storage. In environments that operate several repositories (separate repo for branch/head/bookmark or separate repo per user), this has the potential to drastically reduce storage and network requirements. In the other mode, the name is derived from the remote's path/URL.

File last commit:

r25186:80c5b266 default
r25761:0d37b9b2 default
Show More
children.py
55 lines | 1.8 KiB | text/x-python | PythonLexer
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 # Mercurial extension to provide the 'hg children' command
#
# Copyright 2007 by Intevation GmbH <intevation@intevation.de>
Martin Geisler
add blank line after copyright notices and after header
r8228 #
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 # Author(s):
# Thomas Arendsen Hein <thomas@intevation.de>
#
Martin Geisler
updated license to be explicit about GPL version 2
r8225 # This software may be used and distributed according to the terms of the
Matt Mackall
Update license to GPLv2+
r10263 # GNU General Public License version 2 or any later version.
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Augie Fackler
children: mark extension as deprecated
r16668 '''command to display child changesets (DEPRECATED)
Martin Geisler
children: use hg reST role for example
r16670 This extension is deprecated. You should use :hg:`log -r
"children(REV)"` instead.
Augie Fackler
children: mark extension as deprecated
r16668 '''
Dirkjan Ochtman
help: add/fix docstrings for a bunch of extensions
r8873
Gregory Szorc
children: define inferrepo in command decorator
r21780 from mercurial import cmdutil
Thomas Arendsen Hein
Introduce templateopts and logopts to reduce duplicate option definitions.
r6192 from mercurial.commands import templateopts
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 from mercurial.i18n import _
Gregory Szorc
children: declare command using decorator
r21248 cmdtable = {}
command = cmdutil.command(cmdtable)
Augie Fackler
extensions: document that `testedwith = 'internal'` is special...
r25186 # Note for extension authors: ONLY specify testedwith = 'internal' for
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
# be specifying the version(s) of Mercurial they are tested with, or
# leave the attribute unspecified.
Augie Fackler
hgext: mark all first-party extensions as such
r16743 testedwith = 'internal'
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Gregory Szorc
children: declare command using decorator
r21248 @command('children',
[('r', 'rev', '',
_('show children of the specified revision'), _('REV')),
] + templateopts,
Gregory Szorc
children: define inferrepo in command decorator
r21780 _('hg children [-r REV] [FILE]'),
inferrepo=True)
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 def children(ui, repo, file_=None, **opts):
Martin Geisler
expand "dir" to "directory" in help texts
r8026 """show the children of the given or working directory revision
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Martin Geisler
children: wrap docstrings at 70 characters
r9253 Print the children of the working directory's revisions. If a
revision is given via -r/--rev, the children of that revision will
be printed. If a file argument is given, revision in which the
file was last changed (after the working directory revision or the
argument to --rev if given) is printed.
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 """
rev = opts.get('rev')
if file_:
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 fctx = repo.filectx(file_, changeid=rev)
childctxs = [fcctx.changectx() for fcctx in fctx.children()]
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 else:
Matt Mackall
use repo[changeid] to get a changectx
r6747 ctx = repo[rev]
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 childctxs = ctx.children()
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
displayer = cmdutil.show_changeset(ui, repo, opts)
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 for cctx in childctxs:
Dirkjan Ochtman
cmdutil: use change contexts for cset-printer and cset-templater
r7369 displayer.show(cctx)
Robert Bachmann
Added support for templatevar "footer" to cmdutil.py
r10152 displayer.close()