echo -ne "${A}Usage${B}:\n\n\tTo create a todo/${BASE}.3_beta15 branch:\n\t\t$0 3_beta15\n\n\tTo create a todo/${BASE}_${DATENUM} branch\n\t\t$0 today\n\n"
ERROR=1
fi
if ! git diff --quiet HEAD 2> /dev/null
then
echo -ne "${A}Error${B}:\n\tYour working copy is dirty. Afraid of messing\n\tsomething up, so commit anything that needs to\n\tbe committed, and revert anything that needs\n\tto be reverted, to make your working copy nice\n\tand clean.\n\n"
ERROR=1
fi
if [ ! -f po/Makefile ]
then
echo -ne "${A}Error${B}:\n\tThis seems not to be a build directory, which\n\tis needed for "\""make -Cpo"\"" update-po to work.\n\tChange to your favourite build directory and\n\trun this script from there.\n\n"
ERROR=1
fi
if ! GITROOT="`git rev-parse --show-cdup 2> /dev/null`"
then
echo -ne "${A}Error${B}:\n\tNot in a git repository.\n\n"
ERROR=1
fi
if [ "${VERSTR}" = "bunny" ]
then
echo -ne "${A}Error${B}:\n\t ${A}(\\_/)${B}\n\tSorry, ${A}(O.o)${B} is not a valid version number.\n\t ${A}(> <)${B}\n\n"
fi
if [ ${ERROR} -ne 0 ]
then
exit 1
fi
echo "${A}Creating ${GITBRANCH} branch.${B}"
if ! git checkout -b "${GITBRANCH}"
then
echo -ne "Error:\n\tCould not create branch ${GITBRANCH}.\n\n"
exit 1
fi
echo "${A}make -Cpo update-po${B}"
make -Cpo update-po
git commit -am "make -Cpo update-po"
echo "${A}Bumping version strings to ${FULLVERSTR} and netcode version to ${DATENUM}.${B}"
sed -i 's/\(AC_INIT(\[Warzone 2100\],\[\)'"${BASE}"'\(\],\[http:\/\/wz2100.net\/\],\[warzone2100\])\)/\1'"${FULLVERSTR}"'\2/;