Magellan Linux

Contents of /trunk/pkgtools/svn-branch.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3105 - (show annotations) (download) (as text)
Fri Mar 15 10:10:11 2019 UTC (5 years, 2 months ago) by niro
File MIME type: application/x-sh
File size: 588 byte(s)
-fixed URL regex and honor SUBDIR variable
1 #!/bin/bash
2 export LC_ALL=C
3
4 usage()
5 {
6 echo "Usage: $(basename $0) BRANCH [MESSAGE]"
7 echo
8 echo "Message is optional, you must run this script within a svn tree."
9 echo
10 exit 1
11 }
12
13 BRANCH="$1"
14 MESSAGE="$2"
15 [[ -z ${BRANCH} ]] && usage
16 [[ -z ${Message} ]] && MESSAGE="created branch '${BRANCH}'"
17
18 URI="$(svn info | grep '^URL:' | cut -d' ' -f2)"
19 [[ $? -ne 0 ]] && usage
20 REPO_ROOT="$(svn info | grep 'Repository Root:' | cut -d' ' -f3)"
21 [[ $? -ne 0 ]] && usage
22
23 echo "creating branch ${URI} with '${BRANCH}'..."
24 svn copy -m "${MESSAGE}" "${URI}" "${REPO_ROOT}/${SUBDIR}/branches/${BRANCH}"