-
Notifications
You must be signed in to change notification settings - Fork 5
/
relocateSvn.sh
executable file
·54 lines (48 loc) · 1.18 KB
/
relocateSvn.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash -x
#Moves the selected specified files from one directory to another
#for a Subversion working copy. This script is useful if you have
#a number of different types under one path and just do a bulk svn
#move
set -f
function relocateSvn()
{
find $1 -name $3 -print | \
while read F
do
LD=${#1}
CF=${F:$LD}
FO=`basename $F`
let L=${#F}-${#FO}-$LD
NEWDIR=$2/${F:$LD:$L}
mkdir -p $NEWDIR
find $2 -type d -name '.svn' -prune -o -print | \
while read D
do
if [ ! -d $D ]
then
continue
fi
if [ ! -d "$D/.svn" ]
then
svn add -q $D
fi
done
svn move $F $NEWDIR/
done
}
mkdir -p src2/main/java
mkdir -p src2/main/resources
mkdir -p src2/main/groovy
mkdir -p src2/main/webapp
mkdir -p src2/test/java
mkdir -p src2/test/groovy
mkdir -p src2/test/resources
svn add src2
relocateSvn src src2/main/groovy *.groovy
relocateSvn src src2/main/java *.java
relocateSvn src src2/main/resources *.*
relocateSvn test src2/test/groovy *.groovy
relocateSvn test src2/test/java *.java
relocateSvn test src2/test/resources *.*
relocateSvn conf src/main/resources *.*
relocateSvn conf-web src/main/webapp *.*