今天收到个需求,不做评论,我只呵呵,废话不多说,看script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
|
#!/bin/bash
i=$(svn list svn:
//
*.*.*.*:9361
/projectname
|
tail
-2 |
head
-1 |
cut
-c8)
i=$[$i+1]
branch=
'branchname4.9.'
$i
svn
mkdir
svn:
//
*.*.*.*:9361
/projectname/
$branch -m “
mkdir
”
#svn copy svn://*.*.*.*:9361/projectname/trunk svn://*.*.*.*:9361/projectname/$branch -m "make a $branch"
echo
$branch
mkdir
-p
/home/svncomparetrunk/application
svn checkout svn:
//
*.*.*.*:9361
/projectname/trunk/path/to/application
/home/svncomparetrunk/application
find
/home/svncomparetrunk
-
type
d -name
".svn"
|
xargs
rm
-rf
svn
import
/home/svncomparetrunk
svn:
//
*.*.*.*:9361
/projectname/
$branch -m
"Initial import"
printf
"[projectname:/%s] \n"
"$branch"
>>
/home/svn/projectname/conf/authz
echo
'@program = rw'
>>
/home/svn/projectname/conf/authz
echo
'@admin = rw'
>>
/home/svn/projectname/conf/authz
date
=`
date
+
'%Y%m%d%H%M'
`
DIR_A=$(
find
/home/svncomparetrunk
-
type
f)
DIR_B=$(
find
/home/svncompareonline
-
type
f)
compare ()
{
for
i
in
$1
do
diff
$i $2 >
/script/svn/difftrunk
$
date
.log
if
[$? -
eq
0 ];
then
echo
"$i and $2 are the same
else
echo
"what the fuck!!!"
fi
done
}
for
i
in
$DIR_B
do
compare $DIR_A $i
done
rm
-rf
/home/svncomparetrunk/
*
|
本文转自wks9751CTO博客,原文链接:http://blog.51cto.com/wks97/1613938 ,如需转载请自行联系原作者