~mwhudson/vmbuilder/jenkins_kvm.mwhudson

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Overlays a new branch over this branch. This allows you to reuse code
# from this branch against a development branch or a private branch.

my_script_path=$(readlink -f ${0})
my_s_dir=$(dirname ${my_script_path})

source "${my_s_dir}/functions/bzr_check.sh"
source "${my_s_dir}/functions/common.sh"

rsync_merge() {
    debug "Merging ${1} with private"
    [ -d ${1} ] || fail "no such directory ${1} for merging!"
    rsync -av ${1}/* ${my_s_dir} ||
        fail "failed to merge ${1}"
}

for i in ${@}
do
    check_tmp=$(mktemp --directory --tmpdir=${my_s_dir} bzrbranch.XXX)
    check_branch ${i} ${check_tmp}
    rsync_merge ${check_tmp}
done