#!/bin/bash
MAIN=main
DST_BRANCH=kernel_29
BRANCH_1=kernel_mycompany
BRANCH_2=kernel_mycompany_child
VERSION=LATEST
ls . |while read a
do
echo "mkbranch for $a "
cleartool mkbranch -nc ${DST_BRANCH} $a@@/${MAIN}/${VERSION}
echo "merging $a"
cleartool ls $a@@/${MAIN}/${BRANCH_1}/${BRANCH_2}/${VERSION} >/dev/null
if [ $? -ne 0 ]; then # return error, branch_2 not exist
cleartool ls $a@@/${MAIN}/${BRANCH_1}/${VERSION} >/dev/null
if [ $? -ne 0 ]; then
echo
#cleartool merge -to $a $a@@/${MAIN}/${BRANCH_1}/VERSION
else #branch_1 exist
echo " $a@@/${MAIN}/${BRANCH_1}/${VERSION} exist"
cleartool merge -to $a $a@@/${MAIN}/${BRANCH_1}/${VERSION}
fi
else #branch_2 exist
echo " $a@@/${MAIN}/${BRANCH_1}/${BRANCH_2}/${VERSION} exist"
cleartool merge -to $a $a@@/${MAIN}/${BRANCH_1}/${BRANCH_2}/{VERSION}
fi
done
阅读(927) | 评论(0) | 转发(0) |