hgext/share.py
author Cédric Duval <cedricduval@free.fr>
Mon, 22 Jun 2009 15:48:08 +0200
changeset 8894 868670dbc237
parent 8873 e872ef2e6758
child 9015 ef440eab290f
permissions -rw-r--r--
extensions: improve the consistency of synopses Trying as much as possible to consistently: - use a present tense predicate followed by a direct object - verb referring directly to the functionality provided (ie. not "add command that does this" but simple "do that") - keep simple and to the point, leaving details for the long help (width is tight, possibly even more so for translations) Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom Podlaski Christiansen and others for the helpful suggestions.

# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.

'''share a common history between several working directories'''

import os
from mercurial.i18n import _
from mercurial import hg, commands

def share(ui, source, dest=None, noupdate=False):
    """create a new shared repository (experimental)

    Initialize a new repository and working directory that shares its
    history with another repository.

    NOTE: actions that change history such as rollback or moving the
    source may confuse sharers.
    """

    return hg.share(ui, source, dest, not noupdate)

cmdtable = {
    "share":
    (share,
     [('U', 'noupdate', None, _('do not create a working copy'))],
     _('[-U] SOURCE [DEST]')),
}

commands.norepo += " share"