#!/bin/sh -e
#============================================================================#
# Copy package from Sisyphus to specified branch                             #
#============================================================================#
# (C) Denis Smirnov <mithraen@freesource.info>          http://mithraen.ru/  #
#============================================================================#

branch=$1; shift

if [ -z "$1" ]; then
    echo $(basename $0) -- utlity for copying from sisyphus to branch 
    echo Use: $(basename $0) "<branch name> <package name> [...]"
    exit -1
        
fi

task=`git.alt task new "$branch"`

while ! [ -z "$1" ]; do
    git.alt task add copy "$1" sisyphus
    shift
done

git.alt task run "$task"
