comparison tools/common.sh @ 213:b1d2ea765516

tools: refactor stuff into common.sh, make verify-all-heads not revert.
author Augie Fackler <durin42@gmail.com>
date Fri, 20 Mar 2009 10:18:34 -0500
parents
children 3c87de482011
comparison
equal deleted inserted replaced
212:a421aca2b0f5 213:b1d2ea765516
1 function verify_current_revision()
2 {
3 /bin/rm -rf *
4 exportcmd="svn export `hg svn info 2> /dev/null | grep '^URL: ' | sed 's/URL: //'` -`hg svn parent | sed 's/.*: //;s/ .*//'` . --force"
5 `echo $exportcmd` > /dev/null
6 x=$?
7 if [[ "$x" != "0" ]] ; then
8 echo $exportcmd
9 echo 'export failed!'
10 return 255
11 fi
12 if [[ "`hg st | wc -l`" == "0" ]] ; then
13 return 0
14 else
15 if [[ $1 != "keep" ]] ; then
16 revert_all_files
17 fi
18 return 1
19 fi
20 }
21
22 function revert_all_files()
23 {
24 hg revert --all
25 hg purge
26 }