mk_branch_from_rc 2.24 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/ksh
#
#  Script: mk_branch_from_rc
# 
#  Purpose: 
#      Copies the RC trunk into the branches directory for a RC development 
#      branch.
#
#  Programmer: Hank Childs
#  Creation:   June 23, 2007
#
#  Modifications:
#
14 15 16
#    Hank Childs, Thu Jul  5 16:13:57 PDT 2007
#    Suppress SVN noise.
#
hrchilds's avatar
hrchilds committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
# *****************************************************************************

issueHelp="no"
CDPATH="" # Prevent unneeded echoing of chdir's.

P=$(whence $0)
P2=${P%/*}
. ${P2}/visit_svn_helper

if [[ $# != 2 ]] ; then
   issueHelp="yes"
fi

if [[ "$issueHelp" == "yes" ]] ; then
   echo ""
   echo "Usage:   $0 RC_NAME <branch>"
   echo ""
   echo "Example: $0 1.6.1RC my_dev_work"
   echo "\twill create an RC development branch under REPO/branches/${SVN_NERSC_NAME}/my_dev_work"
   echo ""
   exit 1
fi

SRC=${VISIT_SVN_BRANCHES}/$1
DEST_ROOT=${VISIT_SVN_BRANCHES}/${SVN_NERSC_NAME}
DEST=${DEST_ROOT}/$2

svn ls $DEST_ROOT 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then
   echo "Detected that the directory ${DEST_ROOT} does not exist."
   echo "(This should only be the case if this is your first time developing "
   echo " VisIt in the Subversion repo.)"
   echo "Creating directory $DEST_ROOT"
   svn mkdir $DEST_ROOT -m "Creating branch area for user ${SVN_NERSC_NAME}"
fi

svn ls $DEST 2>/dev/null > /dev/null
if [[ $? == 0 ]] ; then
   echo "The destination branch name ($DEST)"
   echo "already exists.  Please choose a different name"
   exit 1
fi

svn_cp_dir $SRC $DEST
if [[ $? != 0 ]] ; then
   echo "There was an error with creating the branch"
   exit 1
fi

mkdir tmp_forRev$$
cd tmp_forRev$$
echo ""
echo "Logging revision numbers (needed for merging later)..."
70
svn co --quiet $DEST/svninfo
hrchilds's avatar
hrchilds committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
cd svninfo
REV=$(get_latest_rev)
if [[ -f Rev_fromRCTrunk ]] ; then
   echo $REV > Rev_fromRCTrunk
else
   echo $REV > Rev_fromRCTrunk
   svn add Rev_fromRCTrunk
fi

if [[ -f Rev_toRCTrunk ]] ; then
   echo $REV > Rev_toRCTrunk
else
   echo $REV > Rev_toRCTrunk
   svn add Rev_toRCTrunk
fi

if [[ -f Rev_initial ]] ; then
   echo $REV > Rev_initial
else
   echo $REV > Rev_initial
   svn add Rev_initial
fi

94
svn commit --quiet -m "Add revision info for branch ${1}, which originated at revision $REV"
hrchilds's avatar
hrchilds committed
95 96 97 98 99 100 101 102 103
cd ../../
rm -Rf tmp_forRev$$

echo ""
echo "Successful!"
echo ""

return 0