Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findBranches {
- for DIR in $( svn ls $1 )
- do
- if [[ ${DIR} == "branches/" ]]
- then
- for BRANCH in $( svn ls $1${DIR} )
- do
- echo $1${DIR}${BRANCH}
- done
- elif [[ ${DIR} != 'trunk/' && ${DIR} != 'tags/' && ${DIR} == *"/" ] ]
- then
- findBranches $1${DIR}
- fi
- done
- }
- function production {
- read -p "Enter the release branch number: " branch
- findBranches http://svn.techgig.com/ecomm-b2c/ > tmp01.txt
- egrep ${branch} tmp01.txt > tmp02.txt
- echo -ne "<audit>\n\t<project>AUT</project>\n\t<adminTicket></adminTicket>\n\t<fixVersion>${branch}</fixVersion>\n \t<branches>\n"
- for x in $(cat tmp02.csv)
- do
- url=$(svn info ${x} | grep "URL" | sed 's/URL: //')
- revision=$(svn log -v -r0:HEAD -l1 --stop-on-copy ${x} | grep -o "r[0-9]\{1,5\}" | sed "s/r//")
- #echo -ne "${url}/${revision}\n" | sed 's/Revision: //'
- echo -ne "\t\t<branch>\n
- \t\t\t<path>${url}</path>\n
- \t\t\t<startRevision>${revision}</startRevision>\n
- \t\t\t<endRevision></endRevision>\n
- \t\t</branch>\n"
- done
- echo -ne "\t</branches>\n</audit>"
- }
- production > xmlFile.xml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement