Exemple #1
0
def func(parser, options, args):
    """Performs the repository initialisation
    """
    if len(args) != 0:
        parser.error('incorrect number of arguments')

    Stack.initialise(directory.repository)
Exemple #2
0
def func(parser, options, args):
    """Clone the repository into the local dir and initialise the stack."""
    if len(args) != 2:
        parser.error('incorrect number of arguments')

    repository = args[0]
    local_dir = args[1]

    if os.path.exists(local_dir):
        raise CmdException('"%s" exists. Remove it first' % local_dir)

    clone(repository, local_dir)
    os.chdir(local_dir)
    directory = DirectoryHasRepository()
    directory.setup()
    Stack.initialise(directory.repository)